一.基本组成部分
自定义脚本控制震动:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Cinemachine;
public class ImpulseGeneritor : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
var source = GetComponent<CinemachineImpulseSource>();
// 直接产生震动
source.GenerateImpulse();
}
// Update is called once per frame
void Update()
{
}
}