unity3d 播放动画问题

2024-11-08 06:48:58
有1个网友回答
网友(1):

用协同函数写,还要注意,把wrapMode设置为保持最后一帧

        animation["jump"].wrapMode = WrapMode.ClampForever;
        animation["jumpfall"].wrapMode = WrapMode.ClampForever;
        animation["jumpland"].wrapMode = WrapMode.ClampForever;
        animation.Play("jump");
        yield return new WaitForSeconds(animation["jump"].length);
        animation.CrossFade("jumpfall");
        yield return new WaitForSeconds(animation["jumpfall"].length);
        animation.CrossFade("jumpland");