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 () {
}
}

相关文章:

  • 2021-09-11
  • 2022-12-23
  • 2021-06-08
  • 2021-09-08
  • 2021-07-11
  • 2021-05-24
  • 2022-12-23
  • 2021-11-26
猜你喜欢
  • 2021-08-03
  • 2022-12-23
  • 2021-05-31
  • 2022-12-23
  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案