private void OnUseBtnClick(GameObject _go) { if (mCell.transform.childCount > 0) { Destroy(mCell.transform.GetChild(0).gameObject); desLabel.text = ""; GoodInfo goinfo = go.GetComponent <GoodInfo>(); if (goinfo.good.count > 1) { goinfo.good.count--; int count = goinfo.good.count; goinfo.SetNum(count); } else { if (goinfo.good.type == 0) { showEatList.Remove(go); } else { showEquipmentList.Remove(go); } Destroy(go); } } }
private void OnGoodBtnClick(GameObject _go) { if (infoCell.transform.childCount > 0) { Destroy(infoCell.transform.GetChild(0).gameObject); } GameObject go = (GameObject)Instantiate(this.gameObject); GoodInfo goinfo = go.GetComponent <GoodInfo>(); goinfo.good = this.good; //goinfo.good.count = 1; goinfo.SetNum(1); go.transform.parent = infoCell.transform; go.transform.localPosition = Vector3.zero; go.transform.localScale = Vector3.one; ShowArea showAera = infoCell.transform.parent.GetComponent <ShowArea>(); showAera.ShowInfo(good.Describe); showAera.go = this.gameObject; }