public void TriggerAnimEvent(int event_index) { string anim_clip_name = anim.GetCurrentAnimatorClipInfo(0)[0].clip.name; ClipEventList list = GetClipEventList(anim_clip_name); if (GetClipEventList(anim_clip_name) == null || list.events.Count <= event_index) { return; } list.events[event_index].Invoke(); }
public bool RegisterAnimClipEvent(string anim_clip_name, int event_index, UnityAction action) { ClipEventList list = GetClipEventList(anim_clip_name); if (GetClipEventList(anim_clip_name) == null || list.events.Count <= event_index) { return(false); } list.events[event_index].AddListener(action); return(true); }