TimeOutDialog.cs 376 B

123456789101112131415161718192021
  1. using UnityEngine;
  2. using System.Collections;
  3. [RequireComponent(typeof(ScreenBase))]
  4. public class TimeOutDialog : MonoBehaviour
  5. {
  6. public float delay = 3;
  7. public GameObject closeButton;
  8. void OnEnable()
  9. {
  10. StartCoroutine(TimeOutCoroutine());
  11. }
  12. IEnumerator TimeOutCoroutine()
  13. {
  14. yield return new WaitForSeconds(delay);
  15. //closeButton.SendMessage("OnClick");
  16. }
  17. }