}//Start public void SetObject(ObjectTooltipInfo info) { if (transform.localScale.x == 0f) { Show(); } if (info.gameObject != _targetObject) Top.GAME.PlayGlobalSound(Top.GAME.GetRandomSound("ui_hover")); activeTime = 0f; _targetObject = info.transform.gameObject; headerText.text = info.objectName; }//Show
protected void Awake() { if (GetComponent<ObjectTooltipInfo>()) { tooltipInfo = GetComponent<ObjectTooltipInfo>(); } else { throw new MissingComponentException("No tooltip info on object"); } if (GetComponent<Indicator>()) { indicator = GetComponent<Indicator>(); } tooltipInfo.FirstButtonCallback += OnFirstButton; tooltipInfo.SecondButtonCallback += OnSecondButton; }//Start
}//Hide public void SetObject(ObjectTooltipInfo info) { Show(); activeInfo = info; _targetObject = info.transform.gameObject; headerText.text = info.objectName; descriptionText.text = info.description; if (info.showStatus) statusText.text = info.status.ToString(); for (int i = 0; i < buttons.Length; ++i) { if (i < info.buttonNames.Length) { buttons[i].gameObject.SetActive(info.buttonNames[i].enabled); if (buttons[i].gameObject.activeSelf) buttons[i].GetComponentInChildren<Text>().text = info.buttonNames[i].name; } } if (info.showStorage && info.gameObject.GetComponent<StorageObject>()) { ShowStoragePanel(info.gameObject.GetComponent<StorageObject>().objectsStored); } }//SetObject
}//ShowStoragePanel public void UnsetObject() { Hide(); _targetObject = null; activeInfo = null; }//UnsetObject