| | | 1 | | using System.Collections; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using UnityEngine; |
| | | 4 | | |
| | | 5 | | public class DigicodeAreaController : MonoBehaviour |
| | | 6 | | { |
| | | 7 | | |
| | | 8 | | [SerializeField] GameObject rightTeleportationRay; |
| | | 9 | | [SerializeField] GameObject leftTeleportationRay; |
| | | 10 | | [SerializeField] GameObject rightRayInteractor; |
| | | 11 | | [SerializeField] GameObject leftRayInteractor; |
| | | 12 | | |
| | | 13 | | public static bool isInDigicodeArea = false; |
| | | 14 | | |
| | | 15 | | // Start is called before the first frame update |
| | | 16 | | void Start() |
| | 6 | 17 | | { |
| | 6 | 18 | | isInDigicodeArea = false; |
| | 6 | 19 | | } |
| | | 20 | | |
| | | 21 | | private void OnTriggerEnter(Collider other) |
| | 24 | 22 | | { |
| | 24 | 23 | | if (!isInDigicodeArea && other.gameObject.layer == LayerMask.NameToLayer("Player")) |
| | 0 | 24 | | { |
| | | 25 | | //Debug.Log("Collision Head"); |
| | 0 | 26 | | isInDigicodeArea = true; |
| | 0 | 27 | | } |
| | | 28 | | |
| | 24 | 29 | | } |
| | | 30 | | |
| | | 31 | | private void OnTriggerExit(Collider other) |
| | 24 | 32 | | { |
| | 24 | 33 | | if (isInDigicodeArea && other.gameObject.layer == LayerMask.NameToLayer("Player")) |
| | 0 | 34 | | { |
| | 0 | 35 | | isInDigicodeArea = false; |
| | | 36 | | |
| | 0 | 37 | | } |
| | 24 | 38 | | } |
| | | 39 | | |
| | | 40 | | } |