Unity Animator控制动画进度

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_36718838/article/details/80671046

Unity版本 2017.2

 Animator.Play("动画名", 动画所在层, 百分比);

最后的参数范围是0~1,也就是从动画的百分之多少开始播放

 Animator.speed = 0; 

控制当前播放速度为0,就是暂停了。

Animator.GetCurrentAnimatorClipInfo(0)[0].clip.name 

获取当前播放动画的名称

Animator.GetCurrentAnimatorStateInfo(0).normalizedTime

当前动画播放帧数占总帧数的百分比。normalizedTime范围0~1

猜你喜欢

转载自blog.csdn.net/qq_36718838/article/details/80671046