获取动画的时间长度
private Animator ani; private float GetAniLen() { AnimationClip[] clips = ani.runtimeAnimatorController.animationClips; for (int i=0; i<clips.Length; i++) { string clipName = clips[i].name; if(clipName.Contains(要查找的动画名)) { return clips[i].length; } } return 1;//默认给1秒,如果没找到动画,返回默认 }