Projext/Assets/5.TestScript/CamShake.cs
hydrozen1178 6e02e36997 기능 수정 본
회복 기능,적 아이템 드랍,등등
2026-01-30 01:11:10 +09:00

24 lines
733 B
C#

using UnityEngine;
using Cinemachine;
public class CinemachineShake : MonoBehaviour
{
public static CinemachineShake Instance { get; private set; }
private CinemachineImpulseSource _impulseSource;
private void Awake()
{
Instance = this;
_impulseSource = GetComponent<CinemachineImpulseSource>();
}
// ⭐ 힘 부족 시 호출할 도리도리 (좌우 흔들림)
public void ShakeNoNo()
{
if (_impulseSource == null) return;
// Vector3.right 방향으로 신호를 주어 좌우로 흔들리게 합니다.
_impulseSource.GenerateImpulse(Vector3.right * 0.5f);
Debug.Log("<color=red>[Shake]</color> 힘 수치 부족! 도리도리 실행");
}
}