public void Start() { Usable usable = Tools.GetComponentAnywhere <Usable>(gameObject); if ((usable != null) && (nameText != null)) { nameText.text = usable.GetName(); } if (canvas != null) { canvas.enabled = false; } }
private void OnSelectedUsable(Usable usable) { this.usable = usable; if (mainControl != null) { NGUITools.SetActive(mainControl.gameObject, true); } if (nameLabel != null) { NGUITools.SetActive(nameLabel.gameObject, true); nameLabel.text = usable.GetName(); } if (useMessageLabel != null) { NGUITools.SetActive(useMessageLabel.gameObject, true); useMessageLabel.text = string.IsNullOrEmpty(usable.overrideUseMessage) ? defaultUseMessage : usable.overrideUseMessage; } UpdateReticle(); }
private void ShowControls() { if (usable == null) { return; } Tools.SetGameObjectActive(mainGraphic, true); Tools.SetGameObjectActive(nameText, true); Tools.SetGameObjectActive(useMessageText, true); if (nameText != null) { nameText.text = usable.GetName(); } if (useMessageText != null) { useMessageText.text = GetUseMessage(); } if (CanTriggerAnimations() && !string.IsNullOrEmpty(animationTransitions.showTrigger)) { animator.SetTrigger(animationTransitions.showTrigger); } }