美文网首页
unity使用DOTweenAnimation

unity使用DOTweenAnimation

作者: 小巃 | 来源:发表于2018-10-30 17:20 被阅读0次

问题:unity使用DOTweenAnimation如何进行重新开始动画的播放

解决:

需要注意的是:在需要控制重新播放动画的组件中,DoTweenAnimation组件中的AutoPlay,AutoKill这两个一定要取消勾选

解决代码如下:

public class StartAnimation : MonoBehaviour

{

    private void OnEnable()

    {

        if (transform.GetComponent<DOTweenAnimation>() != null)

        {

            print("测试");

            transform.GetComponent<DOTweenAnimation>().DORestart();

        }

    }

}

相关文章

网友评论

      本文标题:unity使用DOTweenAnimation

      本文链接:https://www.haomeiwen.com/subject/fttmpxtx.html