| | | 1 | | using System; |
| | | 2 | | using System.Collections; |
| | | 3 | | using System.Collections.Generic; |
| | | 4 | | using UnityEngine; |
| | | 5 | | |
| | | 6 | | public class ExitDoor : MonoBehaviour |
| | | 7 | | { |
| | 2 | 8 | | bool isOpened = false; |
| | | 9 | | Animator Anim; |
| | | 10 | | |
| | | 11 | | public Timer timer; |
| | | 12 | | |
| | | 13 | | // Start is called before the first frame update |
| | | 14 | | void Start() |
| | 1 | 15 | | { |
| | 1 | 16 | | Anim = this.GetComponent<Animator>(); |
| | 1 | 17 | | } |
| | | 18 | | |
| | | 19 | | public void onFinish() |
| | 3 | 20 | | { |
| | 3 | 21 | | if (!isOpened) |
| | 1 | 22 | | { |
| | 1 | 23 | | isOpened = true; |
| | 1 | 24 | | Anim.SetTrigger("DoorTrigger"); |
| | 1 | 25 | | } |
| | 3 | 26 | | } |
| | | 27 | | |
| | | 28 | | private void OnTriggerEnter(Collider col) |
| | 1 | 29 | | { |
| | 1 | 30 | | if (isOpened) |
| | 0 | 31 | | { |
| | 0 | 32 | | isOpened = false; |
| | 0 | 33 | | Anim.SetTrigger("DoorTrigger"); |
| | 0 | 34 | | timer.removeOutOfTime(); |
| | 0 | 35 | | } |
| | 1 | 36 | | } |
| | | 37 | | } |