void Awake() { inputHandler = GetComponent <InputHandler>(); anim = GetComponentInChildren <Animator>(); locomotion = GetComponent <PlayerLocomotion>(); cameraHandler = FindObjectOfType <CameraHandler>(); interactableUI = FindObjectOfType <InteractableUI>(); }
void Start() { inputHandler = GetComponent <InputHandler>(); anim = GetComponentInChildren <Animator>(); playerLocomotion = GetComponent <PlayerLocomotion>(); playerStats = GetComponent <PlayerStats>(); interactableUI = FindObjectOfType <InteractableUI>(); }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
static public void showActions(Interactable interactable) { if (GameManager.State == GameState.Rehearsal) { if (PathManager.PathTarget != interactable) { return; } } InteractableManager.Instance.activeItem = interactable; GameManager.State = GameState.Interact; InteractableUI.show(interactable); }
private void Raycast() { RaycastHit hit; Debug.DrawRay(playerCamera.transform.position, playerCamera.transform.forward); if (Physics.Raycast(playerCamera.transform.position, playerCamera.transform.forward, out hit, 1f, LayerMask.GetMask(new string[] { "TurretUI", "Tile", "Default" }))) { if (hit.collider.gameObject != target) { if (activeUI) { Destroy(activeUI.gameObject); } target = hit.collider.gameObject; switch (target.layer) { case (int)Layer.Tile: activeUI = Instantiate(tileUI, transform).GetComponent <InteractableUI>(); break; case (int)Layer.TurretUI: activeUI = Instantiate(turretUI, transform).GetComponent <InteractableUI>(); break; } if (!activeUI) { if (target.tag == "Player") { activeUI = Instantiate(genericInteractableUI, transform).GetComponent <InteractableUI>(); activeUI.SetText(Helpers.GetTypeInParents <GenericUIText>(target.transform).text); } } activeUI.target = target; } } else { target = null; if (activeUI) { Destroy(activeUI.gameObject); } } }
private void Awake() { INSTANCE = this; }
private void Awake() { Instance = this; }