/*锁,隐藏时装,隐藏飞翼按钮刷新*/ void refreshObj() { Dictionary <int, uint> dic = A3_FashionShowModel.getInstance().dic_have_fs; foreach (int id in dic_objs.Keys) { if (dic.ContainsKey(id)) { dic_objs[id].transform.FindChild("lock").gameObject.SetActive(false); } else { dic_objs[id].transform.FindChild("lock").gameObject.SetActive(true); } } bool show = A3_FashionShowModel.getInstance().dress_show; getComponentByPath <Toggle>("right_bg/down/shizhuang").isOn = !show; if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.PET_SWING)) { bool showwind = A3_WingModel.getInstance()?.ShowStage > 0 ? false : true; getComponentByPath <Toggle>("right_bg/down/feiyi").isOn = showwind; } }
private void OnEquWing(GameObject go) { A3_WingModel wModel = A3_WingModel.getInstance(); //TODO 装备/卸下翅膀 if (wModel.ShowStage > 0) { if (wingAvatar != null) { if (wingAvatar.transform.FindChild("model/Plus_B").transform.childCount > 0) { GameObject.Destroy(wingAvatar.transform.FindChild("model/Plus_B").transform.GetChild(0).gameObject); } } A3_WingProxy.getInstance().SendShowStage(0); wModel.LastShowState = wModel.ShowStage; go.transform.FindChild("Text").GetComponent <Text>().text = ContMgr.getCont("a3_wing_skin_show"); } else { changeWing(wModel.LastShowState); A3_WingProxy.getInstance().SendShowStage(wModel.LastShowState); go.transform.FindChild("Text").GetComponent <Text>().text = ContMgr.getCont("a3_wing_skin_close"); } }
private void OnEquWing(GameObject go) { A3_WingModel a3_WingModel = ModelBase <A3_WingModel> .getInstance(); bool flag = a3_WingModel.ShowStage > 0; if (flag) { bool flag2 = this.wingAvatar != null; if (flag2) { bool flag3 = this.wingAvatar.transform.FindChild("model/Plus_B").transform.childCount > 0; if (flag3) { UnityEngine.Object.Destroy(this.wingAvatar.transform.FindChild("model/Plus_B").transform.GetChild(0).gameObject); } } BaseProxy <A3_WingProxy> .getInstance().SendShowStage(0); a3_WingModel.LastShowState = a3_WingModel.ShowStage; go.transform.FindChild("Text").GetComponent <Text>().text = "显示飞翼"; } else { this.changeWing(a3_WingModel.LastShowState); BaseProxy <A3_WingProxy> .getInstance().SendShowStage(a3_WingModel.LastShowState); go.transform.FindChild("Text").GetComponent <Text>().text = "隐藏飞翼"; } }
public override void init() { this.wingModel = ModelBase <A3_WingModel> .getInstance(); this.wingXML = this.wingModel.WingXML; this.textName = base.getComponentByPath <Text>("Text_name"); this.textLevel = base.getComponentByPath <Text>("Text_name/lvl"); this.textStage = base.getComponentByPath <Text>("Text_name/stage"); this.btnHelp = new BaseButton(base.getTransformByPath("title/help"), 1, 1); this.btnHelp.onClick = new Action <GameObject>(this.OnOpenHelp); this.tempPgaeAtt = base.getGameObjectByPath("att_temp"); this.conAtt = base.getTransformByPath("att/grid"); this.conLevelTable = base.getTransformByPath("con_level"); this.textSliderState = base.getComponentByPath <Text>("con_level/expbar/text"); this.btnLevelUpgrade = new BaseButton(base.getTransformByPath("con_level/upgrade"), 1, 1); this.btnLevelUpgrade.onClick = new Action <GameObject>(this.OnUpgradeClick); this.btnLevelOneKey = new BaseButton(base.getTransformByPath("con_level/onekey"), 1, 1); this.btnLevelOneKey.onClick = new Action <GameObject>(this.OnUpgradeOneKey); this.conStar = base.getTransformByPath("con_level/con_star"); this.sliderExpBar = base.getComponentByPath <Slider>("con_level/expbar/slider"); this.conCompleteTable = base.getTransformByPath("con_complete"); this.conIcon = base.getTransformByPath("panel_icon/mask/scroll_rect/con_icon"); this.iconTemp = base.getGameObjectByPath("panel_icon/icon_temp"); this.btnTurnLeft = new BaseButton(base.getTransformByPath("panel_icon/btn_left"), 1, 1); this.btnTurnLeft.onClick = new Action <GameObject>(this.OnTurnLeftClick); this.btnTurnRight = new BaseButton(base.getTransformByPath("panel_icon/btn_right"), 1, 1); this.btnTurnRight.onClick = new Action <GameObject>(this.OnTurnRightClick); BaseButton baseButton = new BaseButton(base.getTransformByPath("btn_close"), 1, 1); baseButton.onClick = new Action <GameObject>(this.onClose); this.textLevelCostItemSum = base.getComponentByPath <Text>("con_level/upgrade/text"); this.conStageTable = base.getTransformByPath("con_stage"); this.textStageRate = base.getComponentByPath <Text>("con_stage/rate"); this.textStageCostItemSum = base.getComponentByPath <Text>("con_stage/improve/text"); this.btnStageUp = new BaseButton(base.getTransformByPath("con_stage/improve"), 1, 1); this.btnStageUp.onClick = new Action <GameObject>(this.OnStageUpClick); this.sliderStage = base.getComponentByPath <Slider>("con_stage/slider"); this.sliderStage.onValueChanged.AddListener(new UnityAction <float>(this.OnSliderValueChange)); this.conHelpPanel = base.getTransformByPath("panel_help"); this.btnCloseHelp = new BaseButton(base.getTransformByPath("panel_help/closeBtn"), 1, 1); this.btnCloseHelp.onClick = new Action <GameObject>(this.OnCloseHelp); this.aniExp = this.conLevelTable.GetComponent <Animator>(); this.aniLevelUp = base.getGameObjectByPath("ani_lvlUP"); this.process = new processStruct(new Action <float>(this.Update_wing), "a3_wing_skin", false, false); base.getEventTrigerByPath("panel_icon").onDrag = new EventTriggerListener.VectorDelegate(this.onDragIcon); this.aniStarTrans = base.getTransformByPath("con_level/con_star/ani_star"); this.conStarPoint = base.getTransformByPath("con_level/point"); base.getEventTrigerByPath("con_avatar/avatar_touch").onDrag = new EventTriggerListener.VectorDelegate(this.OnDrag); BaseButton baseButton2 = new BaseButton(base.getTransformByPath("btnWing"), 1, 1); baseButton2.onClick = new Action <GameObject>(this.OnEquWing); this.success = base.transform.FindChild("ani_success").GetComponent <Animator>(); this.fail = base.transform.FindChild("ani_fail").GetComponent <Animator>(); this.needobjid_stage = XMLMgr.instance.GetSXML("wings.stage_item", "").getInt("item_id"); this.needobj_id = XMLMgr.instance.GetSXML("wings.level_item", "").getInt("item_id"); }
public void OnWings(Variant data) { debug.Log("wing::" + data.dump()); int res = data["res"]; switch (res) { case 1: //获得翅膀信息 A3_WingModel.getInstance().InitWingInfo(data); break; case 2: //获得升级强化结果 A3_WingModel.getInstance().SetLevelExp(data); dispatchEvent(GameEvent.Create(ON_LEVEL_EXP_CHANGE, this, data)); break; case 3: //获得进阶结果 A3_WingModel.getInstance().SetStageInfo(data); if (A3_WingModel.getInstance().stageUp) { dispatchEvent(GameEvent.Create(ON_STAGE_CHANGE, this, data)); A3_WingModel.getInstance().SetShowStage(data); dispatchEvent(GameEvent.Create(ON_SHOW_CHANGE, this, data)); } else { dispatchEvent(GameEvent.Create(ON_STAGE_DIFT, this, data)); } break; case 4: //获得自动升级结果 A3_WingModel.getInstance().SetLevelExp(data); dispatchEvent(GameEvent.Create(ON_LEVEL_AUTO_UPGRADE, this, data)); break; case 5: A3_WingModel.getInstance().SetShowStage(data); dispatchEvent(GameEvent.Create(ON_SHOW_CHANGE, this, data)); break; default: Globle.err_output(res); break; } }
//切换翅膀icon背景, 表示当前已选着 public void OnSetIconBGImage(int showStage) { foreach (int key in dicIcon.Keys) { Transform iconBg = dicIcon[key].transform.FindChild("icon_bg"); if (key == showStage) { if (A3_WingModel.getInstance().Stage >= showStage) { iconBg.GetChild(0).gameObject.SetActive(false); iconBg.GetChild(1).gameObject.SetActive(true); iconBg.GetChild(2).gameObject.SetActive(false); } } else { iconBg.GetChild(0).gameObject.SetActive(true); iconBg.GetChild(1).gameObject.SetActive(false); iconBg.GetChild(2).gameObject.SetActive(false); } } }
public override void init() { scrollControer0 = new ScrollControler(); scrollControer0.create(getComponentByPath <ScrollRect>("att")); wingModel = A3_WingModel.getInstance(); wingXML = wingModel.WingXML; textName = this.getComponentByPath <Text>("Text_name"); textLevel = this.getComponentByPath <Text>("Text_name/lvl"); textStage = this.getComponentByPath <Text>("Text_name/stage"); btnHelp = new BaseButton(this.getTransformByPath("title/help")); btnHelp.onClick = OnOpenHelp; tempPgaeAtt = this.getGameObjectByPath("att_temp"); conAtt = this.getTransformByPath("att/grid"); conLevelTable = this.getTransformByPath("con_level"); textSliderState = this.getComponentByPath <Text>("con_level/expbar/text"); btnLevelUpgrade = new BaseButton(this.getTransformByPath("con_level/upgrade")); btnLevelUpgrade.onClick = OnUpgradeClick; btnLevelOneKey = new BaseButton(this.getTransformByPath("con_level/onekey")); btnLevelOneKey.onClick = OnUpgradeOneKey; conStar = this.getTransformByPath("con_level/con_star"); sliderExpBar = this.getComponentByPath <Slider>("con_level/expbar/slider"); conCompleteTable = this.getTransformByPath("con_complete"); conIcon = this.getTransformByPath("panel_icon/mask/scroll_rect/con_icon"); iconTemp = this.getGameObjectByPath("panel_icon/icon_temp"); btnTurnLeft = new BaseButton(this.getTransformByPath("panel_icon/btn_left")); btnTurnLeft.onClick = OnTurnLeftClick; btnTurnRight = new BaseButton(this.getTransformByPath("panel_icon/btn_right")); btnTurnRight.onClick = OnTurnRightClick; BaseButton close_btn = new BaseButton(this.getTransformByPath("btn_close")); close_btn.onClick = onClose; textLevelCostItemSum = this.getComponentByPath <Text>("con_level/upgrade/text"); conStageTable = this.getTransformByPath("con_stage"); textStageRate = this.getComponentByPath <Text>("con_stage/rate"); textStageCostItemSum = this.getComponentByPath <Text>("con_stage/improve/text"); btnStageUp = new BaseButton(this.getTransformByPath("con_stage/improve")); btnStageUp.onClick = OnStageUpClick; sliderStage = this.getComponentByPath <Slider>("con_stage/slider"); sliderStage.onValueChanged.AddListener(OnSliderValueChange); sliderStage.value = 1; conHelpPanel = this.getTransformByPath("panel_help"); btnCloseHelp = new BaseButton(this.getTransformByPath("panel_help/closeBtn")); btnCloseHelp.onClick = OnCloseHelp; aniExp = conLevelTable.GetComponent <Animator>(); aniLevelUp = this.getGameObjectByPath("ani_lvlUP"); process = new processStruct(Update_wing, "a3_wing_skin"); this.getEventTrigerByPath("panel_icon").onDrag = onDragIcon; aniStarTrans = this.getTransformByPath("con_level/con_star/ani_star"); conStarPoint = this.getTransformByPath("con_level/point"); this.getEventTrigerByPath("con_avatar/avatar_touch").onDrag = OnDrag; BaseButton btnWing = new BaseButton(this.getTransformByPath("btnWing")); btnWing.onClick = OnEquWing; success = this.transform.FindChild("ani_success").GetComponent <Animator>(); fail = this.transform.FindChild("ani_fail").GetComponent <Animator>(); needobjid_stage = XMLMgr.instance.GetSXML("wings.stage_item").getInt("item_id"); needobj_id = XMLMgr.instance.GetSXML("wings.level_item").getInt("item_id"); #region 初始化汉字 getComponentByPath <Text>("title/Text").text = ContMgr.getCont("a3_wing_skin_0"); getComponentByPath <Text>("att_temp/text_name").text = ContMgr.getCont("a3_wing_skin_1"); getComponentByPath <Text>("con_level/upgrade/Text").text = ContMgr.getCont("a3_wing_skin_2"); getComponentByPath <Text>("con_level/onekey/Text").text = ContMgr.getCont("a3_wing_skin_3"); getComponentByPath <Text>("con_level/shengyu").text = ContMgr.getCont("a3_wing_skin_4"); getComponentByPath <Text>("con_stage/Text").text = ContMgr.getCont("a3_wing_skin_5"); getComponentByPath <Text>("con_stage/shengyu").text = ContMgr.getCont("a3_wing_skin_4"); getComponentByPath <Text>("con_complete/title/text").text = ContMgr.getCont("a3_wing_skin_6"); getComponentByPath <Text>("btn_equip/Text").text = ContMgr.getCont("a3_wing_skin_7"); getComponentByPath <Text>("panel_icon/icon_temp/lvl").text = ContMgr.getCont("a3_wing_skin_8"); getComponentByPath <Text>("btnWing/Text").text = ContMgr.getCont("a3_wing_skin_9"); getComponentByPath <Text>("panel_help/descTxt").text = ContMgr.getCont("a3_wing_skin_10"); getComponentByPath <Text>("panel_help/closeBtn/Text").text = ContMgr.getCont("a3_wing_skin_11"); #endregion }
public bool CheckUpItem() { if (PlayerModel.getInstance().inFb) { return(false); } // 检查加点 if (PlayerModel.getInstance().up_lvl > 0) { Btn_RefreshOrCreate(PlayerModel.getInstance()?.pt_att > 0, Title_BtnStronger.Player_Attribute); } // 检查装备强化 EquipStrengthOption availableOptions = a3_EquipModel.getInstance().CheckEquipStrengthAvailable()[true]; if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.EQP_ENCHANT)) { Btn_RefreshOrCreate((availableOptions & EquipStrengthOption.Add) != 0x00, Title_BtnStronger.Equipment_Add); } if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.EQP_MOUNTING)) { Btn_RefreshOrCreate((availableOptions & EquipStrengthOption.Gem) != 0x00, Title_BtnStronger.Equipment_Gem); } if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.EQP_ENHANCEMENT)) { Btn_RefreshOrCreate((availableOptions & EquipStrengthOption.Intensify) != 0x00, Title_BtnStronger.Equipment_Intensify); } //Btn_RefreshOrCreate((availableOptions & EquipStrengthOption.Stage) != 0x00, Title_BtnStronger.Equipment_Stageup); // 检查飞翼 if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.PET_SWING)) { Btn_RefreshOrCreate(A3_WingModel.getInstance()?.CheckLevelupAvailable() ?? false, Title_BtnStronger.Wings); } // 检查宠物 //if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.PET)) // Btn_RefreshOrCreate(A3_PetModel.getInstance()?.CheckLevelupAvaiable() ?? false, Title_BtnStronger.Pet); // 检查护盾 //Btn_RefreshOrCreate(HudunModel.getInstance().CheckLevelupAvailable(), Title_BtnStronger.Shield); // 检查技能 if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.SKILL)) { Btn_RefreshOrCreate(Skill_a3Model.getInstance()?.CheckSkillLevelupAvailable() ?? false, Title_BtnStronger.Skill_LevelUp); } // 检查符文 // 检查军衔 if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.ACHIEVEMENT)) { Btn_RefreshOrCreate(a3_RankModel.getInstance()?.CheckTitleLevelupAvailable() ?? false, Title_BtnStronger.Title); } RefreshView(); if (ShownItemNum > 0) { upBtn?.gameObject.SetActive(true); if (!gameObject.activeSelf) { gameObject.SetActive(true); } return(true); } else { upBtn?.gameObject.SetActive(false); if (gameObject.activeSelf) { gameObject.SetActive(false); } return(false); } }