private void OnClick(GameObject go) { switch (go.transform.name) { case "closeBtn": Facade.SendNotification(NotificationID.EquipInformation_Hide); break; case "takeOffBtn": ServerCustom.instance.SendClientMethods(EquipProxy.CLIENT_EQUIP_TAKE_OFF, player_id, cur_equip_info.id); break; case "changeBtn": List <object> list = new List <object>(); Equip_Pos equip_pos = (Equip_Pos)Enum.Parse(typeof(Equip_Pos), (cur_equip_info.position).ToString()); EquipChooseData data = new EquipChooseData(player_id, Equip_Select_Type.Pos, equip_pos, 0); list.Add(data); Facade.SendNotification(NotificationID.EquipChoose_Show, list); break; case "strongBtn": Facade.SendNotification(NotificationID.EquipInformation_Hide); Facade.SendNotification(NotificationID.EquipMain_Show); break; } }
/// <summary> /// 点击装备 /// </summary> /// <param name="data"></param> /// <param name="go"></param> private void ClickEquipItem(UIGridItem item) { EquipItemInfo data = item.oData as EquipItemInfo; if (cur_equip != null) { if (cur_select_player_id == 0 && data.uuid == cur_equip.uuid || cur_select_player_id != 0 && data.itemID == cur_equip.itemID) { return; } } if (string.IsNullOrEmpty(data.itemID)) { Equip_Pos pos = (Equip_Pos)Enum.Parse(typeof(Equip_Pos), data.position.ToString()); item.Selected = false; if (last_equip_item != null) { last_equip_item.Selected = true; } if (EquipConfig.GetEquipDataListByPos((int)pos).Count == 0) { GUIManager.SetPromptInfo(TextManager.GetUIString("UI2052"), null); return; } List <object> list = new List <object>(); EquipChooseData info = new EquipChooseData(cur_select_player_id, Equip_Select_Type.Pos, pos, 0); list.Add(info); Facade.SendNotification(NotificationID.EquipChoose_Show, list); return; } cur_equip = data; if (last_equip_item != null) { last_equip_item.Selected = false; } last_equip_item = item; OpenFunction(); }
/// <summary> /// 界面显示 /// </summary> protected override void OnShow(INotification notification) { if (equipChooseMediator == null) { equipChooseMediator = Facade.RetrieveMediator("EquipChooseMediator") as EquipChooseMediator; } select_data = (notification.Body as List <object>)[0] as EquipChooseData; player_id = select_data.player_id; select_pos = select_data.pos; select_type = select_data.type; select_level = select_data.select_level; panel.chooseGrid.enabled = true; panel.chooseGrid.BindCustomCallBack(ChooseGrid_UpdateItem); panel.chooseGrid.StartCustom(); SetInfo(); }
private void OnClick(GameObject go) { switch (go.transform.name) { case "inheritBtn": if (select_equip_data == null) { return; } long inherit_id = GameConvert.LongConvert(select_equip_data.uuid); int need_euro = GetNeedEuro(); if (PlayerMediator.playerInfo.euro < need_euro) { GUIManager.SetPromptInfo(TextManager.GetUIString("equip_error_6"), null); return; } ServerCustom.instance.SendClientMethods(EquipProxy.CLIENT_EQUIP_INHERIT, EquipMediator.cur_select_player_id, select_equip_id, inherit_id); break; case "selectbg": List <EquipItemInfo> equip_list = EquipConfig.GetEquipDataListByLv(cur_strong_lv + 10); if (equip_list.Count <= 0) { GUIManager.SetPromptInfo(TextManager.GetSystemString("ui_system_24"), null); return; } EquipChooseMediator.SelectItem = new EquipChooseMediator.SelectItemHandle(SelectEquip); List <object> list = new List <object>(); EquipChooseData data = new EquipChooseData(EquipMediator.cur_select_player_id, Equip_Select_Type.Level, Equip_Pos.Null, cur_strong_lv + 10); list.Add(data); Facade.SendNotification(NotificationID.EquipChoose_Show, list); break; } }