using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AnimatorEvent : StateMachineBehaviour
{
static int statePropertyId = Animator.StringToHash("State");
static Dictionary<int, string> hashToName = new Dictionary<int, string>();
static AnimatorEvent()
{
foreach (string name in new string[] { "eat", "hit", "animation"})
hashToName.Add(Animator.StringToHash(name), name);
}
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
animator.SetInteger(statePropertyId, -1);
}
}
