码迷,mamicode.com
首页 > 其他好文 > 详细

动画播完时关闭动画

时间:2019-06-12 19:37:18      阅读:81      评论:0      收藏:0      [点我收藏+]

标签:star   div   animator   line   void   str   color   format   tco   

Returns an AnimatorStateInfo with the information on the current state.

this.GetComponent<Animator>().GetCurrentAnimatorStateInfo(0)

 

代码如下: 

public class AnimationAutoDestory : MonoBehaviour {

 

    public float delay = 1f;
    // Use this for initialization
    void Start () {
        Destroy(gameObject, this.GetComponent<Animator>().GetCurrentAnimatorStateInfo(0).length + delay);
    }
// Update is called once per frame
void Update () {
}
}

动画播完时关闭动画

标签:star   div   animator   line   void   str   color   format   tco   

原文地址:https://www.cnblogs.com/sy-liu/p/11011649.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!