public void InitData(Animator ani)
{
if (ani == null)
{
return;
}
m_animator = ani;
m_animator.enabled = false;
AnimationClip clip = m_animator.runtimeAnimatorController.animationClips[0];
speed = m_animator.GetCurrentAnimatorStateInfo(0).speed;
//通过测试得知,速度改变是成平方的关系,比如speed为2,则比原速度快4倍
time = clip.length / (speed * speed);
Debug.Log(time);
AnimationManager.Instance.PlayPause(m_animator);
}
unity Animator获得当前动画最真实的时间
最新推荐文章于 2023-06-20 15:53:08 发布