DestroyLater.cs 460 B

12345678910111213141516171819
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace SoftKitty.InventoryEngine
  5. {
  6. /// <summary>
  7. /// Destory the gameobject after a few seconds
  8. /// </summary>
  9. public class DestroyLater : MonoBehaviour
  10. {
  11. public float WaitTime = 2.5F;
  12. IEnumerator Start()
  13. {
  14. yield return new WaitForSeconds(WaitTime);
  15. Destroy(gameObject);
  16. }
  17. }
  18. }