using RR.Common.Managers; using RR.Game2D.Behaviour; using RR.Game2D.Core.Managers; using UnityEngine; public class PlayerAnimationEvents : MonoBehaviour { [SerializeField] private AudioClip deathSound; private PlayerController _controller; private Rigidbody2D _rb; private void Awake() { _controller = GetComponent(); _rb = GetComponent(); } public void OnDeathEnd() { Animator animator = GetComponent(); animator.ResetTrigger("Death"); gameObject.layer = LayerMask.NameToLayer("Default"); _rb.constraints = RigidbodyConstraints2D.FreezeRotation; GameManager.Instance.RespawnPlayer(); } public void PlaySfx(AudioClip sound) { // Debug.Log($"StepSound: {stepSound}"); if (sound != null) GameManager.Instance.Audio.PlaySfxAt(sound, transform.position, 0.5f); // AudioManager.Instance.PlaySfxAt(stepSound, transform.position); } }