image.png
public void Reset()
{
Animator.SetInteger("AnimIndex", 0);
}
public void InitAnimationEvent()
{
AnimationEvent evt;
evt = new AnimationEvent();
evt.time = 0f;
evt.functionName = "Reset";
var clips = Animator.runtimeAnimatorController.animationClips;
for (int i = 0; i < clips.Length; i++)
{
Animator.runtimeAnimatorController.animationClips[i].AddEvent(evt);
}
}
网友评论