当先锋百科网

首页 1 2 3 4 5 6 7

原创文章如需转载请注明:转载自 脱莫柔Unity3D学习之旅 QQ群:【Unity3D(AR/VR) 334163814】【Unity3D(游戏) 119706192】 本文链接地址:Animator不常用方法

------------------------------------------------------------------------------------------------------------------------------------------

isPlaying

bool isAnimatorPlaying()
{
        float playing = Mathf.Clamp01(myAnimator.GetCurrentAnimatorStateInfo(0).normalizedTime);
        
        if (正播)
            return playing < 1;
        else//倒播
            return playing > 1;
}

回到起始帧

public void animToStart()
{
        //动作名,层,时间
        animator.Play("Take 001", -1, 0f);
        animator.Update(0f);
}