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 () {
}
}
原文地址:https://www.cnblogs.com/sy-liu/p/11011649.html
时间: 2024-10-04 17:32:18