20 lines
397 B
C#
20 lines
397 B
C#
using UnityEngine;
|
|
using Cinemachine;
|
|
|
|
public class CameraShakeNew : MonoBehaviour
|
|
{
|
|
public static CameraShakeNew Instance;
|
|
|
|
private CinemachineImpulseSource impulseSource;
|
|
|
|
void Awake()
|
|
{
|
|
Instance = this;
|
|
impulseSource = GetComponent<CinemachineImpulseSource>();
|
|
}
|
|
|
|
public void Shake(float force)
|
|
{
|
|
impulseSource.GenerateImpulse(force);
|
|
}
|
|
} |