| | | 1 | | using System.Collections; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using UnityEngine; |
| | | 4 | | using UnityEngine.XR.Interaction.Toolkit; |
| | | 5 | | using UnityEngine.InputSystem; |
| | | 6 | | |
| | | 7 | | public class ActivateTeleportationRay : MonoBehaviour |
| | | 8 | | { |
| | | 9 | | [SerializeField] GameObject rightTeleportation; |
| | | 10 | | |
| | | 11 | | [SerializeField] InputActionProperty rightActivate; |
| | | 12 | | |
| | | 13 | | [SerializeField] InputActionProperty rightCancel; |
| | | 14 | | |
| | | 15 | | [SerializeField] GameObject leftTeleportation; |
| | | 16 | | |
| | | 17 | | [SerializeField] InputActionProperty leftActivate; |
| | | 18 | | |
| | | 19 | | [SerializeField] InputActionProperty leftCancel; |
| | | 20 | | |
| | | 21 | | [SerializeField] GameObject overlay; |
| | | 22 | | |
| | | 23 | | [SerializeField] GameObject rightRayController; |
| | | 24 | | [SerializeField] GameObject leftRayController; |
| | | 25 | | |
| | | 26 | | |
| | | 27 | | |
| | | 28 | | // Start is called before the first frame update |
| | | 29 | | void Start() |
| | 0 | 30 | | { |
| | | 31 | | |
| | 0 | 32 | | } |
| | | 33 | | |
| | | 34 | | // Update is called once per frame |
| | | 35 | | void Update() |
| | 0 | 36 | | { |
| | 0 | 37 | | if(!PauseMenuController.gameIsPaused) |
| | 0 | 38 | | { |
| | 0 | 39 | | if(DigicodeAreaController.isInDigicodeArea) |
| | 0 | 40 | | { |
| | 0 | 41 | | rightRayController.SetActive(rightCancel.action.ReadValue<float>() == 0 && rightActivate.action.ReadValu |
| | 0 | 42 | | leftRayController.SetActive(leftCancel.action.ReadValue<float>() == 0 && leftActivate.action.ReadValue<f |
| | 0 | 43 | | rightTeleportation.SetActive(false); |
| | 0 | 44 | | leftTeleportation.SetActive(false); |
| | 0 | 45 | | } |
| | | 46 | | else |
| | 0 | 47 | | { |
| | 0 | 48 | | rightTeleportation.SetActive(rightCancel.action.ReadValue<float>() == 0 && rightActivate.action.ReadValu |
| | 0 | 49 | | leftTeleportation.SetActive(leftCancel.action.ReadValue<float>() == 0 && leftActivate.action.ReadValue<f |
| | 0 | 50 | | rightRayController.SetActive(false); leftRayController.SetActive(false); |
| | 0 | 51 | | } |
| | 0 | 52 | | } |
| | 0 | 53 | | } |
| | | 54 | | } |