| | | 1 | | using System.Collections; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using UnityEngine; |
| | | 4 | | using UnityEngine.UI; |
| | | 5 | | |
| | | 6 | | public class Timeout : MonoBehaviour |
| | | 7 | | { |
| | | 8 | | public GameObject canvas; |
| | | 9 | | |
| | | 10 | | // Start is called before the first frame update |
| | | 11 | | void Start() |
| | 1 | 12 | | { |
| | 1 | 13 | | StartCoroutine(ExecuteAfterTime(60)); |
| | 1 | 14 | | } |
| | | 15 | | |
| | | 16 | | private void Update() |
| | 2817 | 17 | | { |
| | 2817 | 18 | | if (Input.GetButtonDown("Fire1")) |
| | 0 | 19 | | { |
| | 0 | 20 | | canvas.SetActive(false); |
| | 0 | 21 | | } |
| | 2817 | 22 | | } |
| | | 23 | | |
| | | 24 | | public IEnumerator ExecuteAfterTime(float time) |
| | 1 | 25 | | { |
| | 1 | 26 | | yield return new WaitForSeconds(time); |
| | 0 | 27 | | canvas.SetActive(false); |
| | 0 | 28 | | } |
| | | 29 | | } |