WFX_Demo_DeleteAfterDelay.cs 255 B

1234567891011121314
  1. using UnityEngine;
  2. using System.Collections;
  3. public class WFX_Demo_DeleteAfterDelay : MonoBehaviour
  4. {
  5. public float delay = 1.0f;
  6. void Update ()
  7. {
  8. delay -= Time.deltaTime;
  9. if(delay < 0f)
  10. GameObject.Destroy(this.gameObject);
  11. }
  12. }