動畫播完時關閉動畫

Returns an AnimatorStateInfo with the information on the current state.html

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

 

代碼以下: this

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 () {
}
}
相關文章
相關標籤/搜索