public void Awake() { _frame = this.GetComponent <Image> (); foreach (Transform _tr in this.transform) { if (_cnttxt == null) { _cnttxt = _tr.GetComponent <Text> (); } if (_iconimg == null) { _iconimg = _tr.GetComponent <Image> (); } } this.onClick.AddListener(() => { if (_Items != null && (_Items._NModel >= (int)ModelEnum.Food && _Items._NModel <= (int)ModelEnum.FoodEnd) || (_Items._NModel >= (int)ModelEnum.Equip && _Items._NModel <= (int)ModelEnum.EquipEnd)) { TTUIPage.ShowPage <UIItemPage>(); UIItemPageImpl.Instance().setinfo(this); } else if (_Items._NModel >= (int)ModelEnum.ActionAttack && _Items._NModel <= (int)ModelEnum.AttackEnd) { //GameResources.Instance()._GameMgr._AIPlayer.onattackenter(this); } else { GameResources.Instance()._GameMgr._AIPlayer.onitemclick(this); } }); }
public override void Awake(GameObject go) { UIItemPageImpl.Instance()._Name = this.transform.Find("Name").GetComponent <Text>(); UIItemPageImpl.Instance()._Desc = this.transform.Find("Desc").GetComponent <Text>(); UIItemPageImpl.Instance()._Prop = this.transform.Find("Prop").GetComponent <Text>(); UIItemPageImpl.Instance()._Cnt = this.transform.Find("Cnt").GetComponent <Text>(); UIItemPageImpl.Instance()._Frm = this.transform.Find("frm").GetComponent <Image>(); UIItemPageImpl.Instance()._Icon = this.transform.Find("icon").GetComponent <Image>(); UIItemPageImpl.Instance()._Btn2 = this.transform.Find("btn2").GetComponent <Button> (); UIItemPageImpl.Instance()._Btn1 = this.transform.Find("btn1").GetComponent <Button> (); UIItemPageImpl.Instance()._Btn0 = this.transform.Find("btn0").GetComponent <Button> (); UIItemPageImpl.Instance().init(); }