public override void onShowed() { ResetLvLProxy.getInstance().addEventListener(ResetLvLProxy.EVENT_RESETLVL, onResetLvLSucc); lab_fightingCapacityValue.text = PlayerModel.getInstance().combpt.ToString(); lab_level.text = ContMgr.getCont("a3_resetlvl_lv", new List <string>() { PlayerModel.getInstance().up_lvl.ToString(), PlayerModel.getInstance().lvl.ToString() }); profession = PlayerModel.getInstance().profession; zhuan = PlayerModel.getInstance().up_lvl; uint lvl = PlayerModel.getInstance().lvl; uint exp = ResetLvLModel.getInstance().getExpByResetLvL(profession, zhuan, lvl); uint currentExp = PlayerModel.getInstance().exp > ResetLvLModel.getInstance().getAllExpByZhuan(profession, zhuan)?ResetLvLModel.getInstance().getAllExpByZhuan(profession, zhuan):PlayerModel.getInstance().exp; lab_experience.text = string.Format("{0}/{1}", currentExp, ResetLvLModel.getInstance().getAllExpByZhuan(profession, zhuan));// 玩家经验/当前转等级经验 sliderExperience.maxValue = ResetLvLModel.getInstance().getAllExpByZhuan(profession, zhuan); sliderExperience.value = PlayerModel.getInstance().exp; statusPointStr = ResetLvLModel.getInstance().getAwardAttrPointByZhuan(profession, zhuan).ToString(); createNum(uint.Parse(statusPointStr)); lab_waradEquip.text = getAwardDescStr(zhuan); lab_consumeGolds.text = ResetLvLModel.getInstance().getNeedGoldsByZhuan(profession, zhuan).ToString(); lab_consumeGolds.color = getGoldsColor(); txt_currentZhuan.sprite = GAMEAPI.ABUI_LoadSprite("icon_resetlvl_" + zhuan); // zhuan.ToString()+"转"; txt_targetZhuan.sprite = GAMEAPI.ABUI_LoadSprite("icon_resetlvl_" + (zhuan + 1)); //(zhuan + 1).ToString() + "转"; nextZhuanLvl.text = ContMgr.getCont("a3_resetlvl_lv", new List <string>() { (zhuan + 1).ToString(), ResetLvLModel.getInstance().getNextLvLByZhuan(profession, zhuan, currentExp).ToString() }); createAvatar(); btn_description.addEvent(); btn_reincarnation.addEvent(); btn_close.addEvent(); touchBG.addEvent(); }
public override void onClosed() { ResetLvLProxy.getInstance().removeEventListener(ResetLvLProxy.EVENT_RESETLVL, onResetLvLSucc); btn_close.removeAllListener(); btn_description.removeAllListener(); btn_reincarnation.removeAllListener(); touchBG.removeAllListener(); disposeAvatar(); }
void onReincarnationClick(GameObject go) { uint needGolds = ResetLvLModel.getInstance().getNeedGoldsByZhuan(profession, zhuan); if (needGolds > PlayerModel.getInstance().money) { InterfaceMgr.getInstance().close(InterfaceMgr.A3_RESETLVL); flytxt.instance.fly(ContMgr.getCont("comm_nomoney")); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_GETGOLDWAY); } else { //向服务器发转生消息 ResetLvLProxy.getInstance().sendResetLvL(); } }
void onLvlUp(Variant msgData) { if (a3_liteMinimap.instance != null) { a3_liteMinimap.instance.function_open(a3_liteMinimap.instance.fun_i); } //NetClient.instance.dispatchEvent( // GameEvent.Create(GAME_EVENT.ON_LVL_UP, this, msgData) //); //if (msgData.ContainsKey("pinfo")) //{ // NetClient.instance.dispatchEvent( // GameEvent.Create(GAME_EVENT.R_PLAYER_INFO_CHANGED, this, null) // ); // NetClient.instance.dispatchEvent( // GameEvent.Create(GAME_EVENT.PLAYER_INFO_CHANGED, this, null) // ); //} //Variant plyInfo = new Variant(); //NetClient.instance.dispatchEvent( // GameEvent.Create(GAME_EVENT.MODIFY_TEAMMATE_DATA, this, msgData["lvlshare"]) // ); debug.Log("收到升级或者转生的协议........." + msgData.dump()); if (msgData.ContainsKey("cid")) { if (msgData["cid"] != PlayerModel.getInstance().cid) { if (OtherPlayerMgr._inst != null && OtherPlayerMgr._inst.m_mapOtherPlayer.Count > 0) { if (OtherPlayerMgr._inst.m_mapOtherPlayer.ContainsKey(msgData["iid"])) { OtherPlayerMgr._inst.m_mapOtherPlayer[msgData["iid"]].zhuan = msgData["zhuan"]; } } //点击的角色在你身边升到1转以上了 if (SelfRole._inst != null && SelfRole._inst.m_LockRole != null && SelfRole._inst.m_LockRole.m_unIID == msgData["iid"]) { PkmodelAdmin.RefreshShow(SelfRole._inst.m_LockRole, true); } // // (SelfRole._inst.m_LockRole as ProfessionRole).lvl = msgData["lvl"]; // //(SelfRole._inst.m_LockRole as ProfessionRole).zhuan= msgData["zhuan"]; } else { PlayerModel.getInstance().lvUp(msgData); dispatchEvent(GameEvent.Create(EVENT_SELF_ON_LV_CHANGE, this, msgData)); if (msgData.ContainsKey("pinfo")) { InterfaceMgr.doCommandByLua("PlayerModel:getInstance().modExp", "model/PlayerModel", (uint)msgData["pinfo"]["exp"]); } if (msgData.ContainsKey("mod_exp")) { flytxt.instance.fly("EXP+" + msgData["mod_exp"], 3); } } } if (a3_QHmaster.instance != null) { a3_QHmaster.instance.refreshDashi(); } dispatchEvent(GameEvent.Create(EVENT_ON_LV_CHANGE, this, msgData)); ResetLvLProxy.getInstance().resetLvL(); }