//Text infoButtonText; public void Start() { Transform tran = transform.FindChild("GoodButton"); if (tran != null) { goodButton = tran.GetComponent <Button>(); goodButtonText = tran.GetComponentInChildren <Text>(); goodButton.onClick.RemoveAllListeners(); goodButton.onClick.AddListener(BuyGood); leftButtomModifier = tran.FindChild("LeftButtomModifier").gameObject; if (leftButtomModifier != null) { modifierText = leftButtomModifier.GetComponentInChildren <Text>(); leftButtomModifier.SetActive(false); } } materialTexts = new Text[MaterialTextNum]; for (int i = 0; i < MaterialTextNum; i++) { tran = transform.FindChild(String.Format("MaterialText ({0})", i)); if (tran != null) { materialTexts[i] = tran.GetComponent <Text>(); } } if (materialTexts[0] != null) { materialTextColorA = materialTexts[0].color.a; } tran = transform.FindChild("InfoButton"); if (tran != null) { infoButton = tran.GetComponent <Button>(); infoButton.onClick.RemoveAllListeners(); infoButton.onClick.AddListener(delegate { InfoPanel.Pop(good.name + " " + good.description); }); //infoButtonText = tran.GetComponentInChildren<Text>(); } checkImage = transform.FindChild("CheckImage").gameObject; if (checkImage != null) { checkImage.SetActive(false); } goodSeller = GameObject.Find("GoodsSeller"); if (goodSeller != null) { goodSellerManagerScript = goodSeller.GetComponent <GoodsSellerManager>(); } }
void ShowDescription() { InfoPanel.Pop(gameElement.description); }