Files
Continentis/Assets/Plugins/AllIn1VfxToolkit/Demo & Assets/Demo/Scripts/AllIn1DoShake.cs
SoulliesOfficial d09b58fd80 架构大更
2026-03-20 11:56:50 -04:00

26 lines
760 B
C#

using UnityEngine;
namespace AllIn1VfxToolkit.Demo.Scripts
{
public class AllIn1DoShake : MonoBehaviour
{
[SerializeField] private float shakeAmount = 0.15f;
[SerializeField] private bool doShakeOnStart;
[SerializeField] private float shakeOnStartDelay;
private void Start()
{
if (doShakeOnStart)
{
if (shakeOnStartDelay < Time.deltaTime) DoShake();
else Invoke(nameof(DoShake), shakeOnStartDelay);
}
}
public void DoShake()
{
if (AllIn1Shaker.i != null) AllIn1Shaker.i.DoCameraShake(shakeAmount);
else Debug.LogError("No AllIn1Shaker found. Please add one to the scene");
}
}
}