赞
踩
AnimatorStateInfo.normalizedTime
float normalizedTime;
Description:
Normalized time of the State.
The integer part is the number of time a state has been looped. The fractional part is the % (0-1) of progress in the current loop.
2. 代码如下:
private Animator animator;
void Start()
{
animator = this.GetComponent<Animator>();
}
void Update()
{
AnimatorStateInfo info = animator.GetCurrentAnimatorStateInfo(0);
// 判断动画是否播放完成
if( info.normalizedTime >= 1.0f)
{
DoSomething();
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。