Danro/Assets/Scripts/Behaviour/Animations/PlayerAnimationEvents.cs

23 lines
574 B
C#

using RR.Game2D.Behaviour;
using RR.Game2D.Core;
using UnityEngine;
public class PlayerAnimationEvents : MonoBehaviour
{
private PlayerController _controller;
private Rigidbody2D _rb;
private void Awake()
{
_controller = GetComponent<PlayerController>();
_rb = GetComponent<Rigidbody2D>();
}
public void OnDeathEnd()
{
Animator animator = GetComponent<Animator>();
animator.ResetTrigger("Death");
gameObject.layer = LayerMask.NameToLayer("Default");
GameManager.Instance.RespawnPlayer();
}
}