챕터2 유나루트 완료
This commit is contained in:
@@ -8,6 +8,9 @@ public class NPCController : MonoBehaviour
|
||||
[Tooltip("애니메이션 이벤트로 켜고 끌 이펙트들 — 이벤트의 Int 파라미터가 이 목록의 인덱스")]
|
||||
[SerializeField] private GameObject[] _animationEffects;
|
||||
|
||||
[Tooltip("애니메이션 이벤트로 재생할 SFX들 — 이벤트의 Int 파라미터가 이 목록의 인덱스")]
|
||||
[SerializeField] private AudioClip[] _animationSfx;
|
||||
|
||||
private static readonly int _speedHash = Animator.StringToHash("Speed");
|
||||
|
||||
private Vector3 _lastPosition;
|
||||
@@ -81,4 +84,18 @@ private GameObject GetEffect(int effectNo)
|
||||
}
|
||||
return _animationEffects[effectNo];
|
||||
}
|
||||
|
||||
// 애니메이션 이벤트용 — 등록된 SFX를 재생 (Int 파라미터 = _animationSfx 인덱스)
|
||||
public void OnAnimationSfx(int sfxNo)
|
||||
{
|
||||
if (_animationSfx == null || sfxNo < 0 || sfxNo >= _animationSfx.Length
|
||||
|| _animationSfx[sfxNo] == null)
|
||||
{
|
||||
Debug.LogWarning($"[NPCController] 등록되지 않은 SFX 번호: {sfxNo} ({name})");
|
||||
return;
|
||||
}
|
||||
|
||||
if (SoundManager.Instance != null)
|
||||
SoundManager.Instance.PlaySFX(_animationSfx[sfxNo]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user