private Animator animator;
public void GetLengthByName(string name)
{
float length = 0;
AnimationClip[] clips = animator.runtimeAnimatorController.animationClips;
foreach(AnimationClip clip in clips)
{
if(clip.name.Equals(name)
{
length = clip.length;
break;
}
}
Debug.Log(length);
}
Unity中获取Animator中动画片段的时长
最新推荐文章于 2024-04-28 14:39:58 发布