private void OnClick_bagItem(BattleEquip_PossessItem com) { if (com.Initiative) { MobaMessageManagerTools.SendClientMsg(ClientV2C.BattleShop_clickItemInBag, com.ItemData, false); } }
public override void Init() { base.Init(); this.template_possessItem = Resources.Load <BattleEquip_PossessItem>("Prefab/UI/BattleEquipment/PossessItem"); this.template_attri = Resources.Load <BattleEquip_AttriItem>("Prefab/UI/BattleEquipment/AttriItem"); this.template_recommendItem = Resources.Load <BattleEquip_recommendItem>("Prefab/UI/BattleEquipment/RecommendItem"); this.panel = this.transform.GetComponent <UIPanel>(); this.grid_recommend = this.transform.FindChild("Anchor/RAnchor/RecommendGrid").GetComponent <UIGrid>(); this.grid_bag = this.transform.Find("Anchor/DAnchor/EquipmentGrid").GetComponent <UIGrid>(); this.btn_shop = this.transform.Find("Anchor/DAnchor/Btn"); this.label_money = this.transform.Find("Anchor/DAnchor/Btn/Money").GetComponent <UILabel>(); this.label_money2 = this.transform.Find("Anchor/SAnchor/Money").GetComponent <UILabel>(); this.TopAnchor = this.transform.Find("Anchor/TopAnchor"); this.DAnchor = this.transform.FindChild("Anchor/DAnchor"); this.SAnchor = this.transform.FindChild("Anchor/SAnchor"); this.RAnchor = this.transform.FindChild("Anchor/RAnchor"); UIEventListener.Get(this.btn_shop.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnClick_ownShop); UIEventListener.Get(this.SAnchor.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnClick_ownShop); this.grid_attri = this.transform.Find("Anchor/DAnchor/NatureGrid").GetComponent <UIGrid>(); this.buyBtnEffect = this.transform.FindChild("Anchor/DAnchor/Btn/Fx_ui_MoneyEnough").gameObject; this.buyBtnEffect_s = this.transform.FindChild("Anchor/SAnchor/Fx_ui_MoneyEnough").gameObject; this.dicAttriCom = new Dictionary <AttrType, BattleEquip_AttriItem>(); this.dicRecommendItemCom = new Dictionary <string, BattleEquip_recommendItem>(); this.listPItemsCom = new List <BattleEquip_PossessItem>(); this.recommendItemsSub = new List <RItemData>(); this.msgs = new object[] { ClientC2V.BattleShop_possessItemsChanged, ClientC2V.BattleShop_walletChanged, ClientC2C.HeroAttrChange, ClientC2V.BattleShop_recommendItemsSubChanged, ClientC2V.BattleShop_inShopAreaChanged, ClientC2V.BattleShop_playerAliveChanged, ClientV2V.DetailedShopToggle, ClientV2V.SetSkillPanelPivot }; this.template_possessItem.RootGoObj = this.gameObject; this.template_recommendItem.RootGoObj = this.gameObject; Bounds bounds = NGUIMath.CalculateRelativeWidgetBounds(this.DAnchor); this.RAchorOffset = new Vector2[] { new Vector2(0f, bounds.size.y + 10f), new Vector2(bounds.size.x + 10f, 0f) }; }