Files
5.24BuYu/Assets/GG Camera Shake/Samples/Stompa/Scripts/ShakeTrigger.cs
T
2026-04-21 23:02:51 +08:00

20 lines
497 B
C#

using UnityEngine;
// Don't forget to add this.
using CameraShake;
public class ShakeTrigger : MonoBehaviour
{
// Parameters of the shake to tweak in the inspector.
public BounceShake.Params shakeParams;
// This is called by animator.
public void Stomp()
{
Vector3 sourcePosition = transform.position;
// Creating new instance of a shake and registering it in the system.
CameraShaker.Shake(new BounceShake(shakeParams, sourcePosition));
}
}