/// <summary> /// 更新等级 /// </summary> /// <param name="buf"></param> private void OnUpdateLevel(KProtoBuf buf) { S2C_UPDATE_LEVEL respond = buf as S2C_UPDATE_LEVEL; if (m_PlayerInfo.Uid != respond.nuid) { return; } if (m_PlayerInfo.Level != respond.nlevel) { m_PlayerInfo.Level = respond.nlevel; GameFacade.Instance.SendNotification(NotificationName.MSG_PLAYER_LEVEL_UP, m_PlayerInfo.Level); } if (m_PlayerInfo.WatchLv != respond.dan_level) { m_PlayerInfo.WatchLv = respond.dan_level; GameFacade.Instance.SendNotification(NotificationName.MSG_PLAYER_WATCH_LEVEL_UP); UIManager.Instance.OpenPanel(UIPanel.AccountUpaPanel); } m_PlayerInfo.Exp = respond.dExp; m_PlayerInfo.WatchExp = respond.dan_exp; }
private void OnRoleUpdateLevel(KProtoBuf buf) { S2C_UPDATE_LEVEL respond = buf as S2C_UPDATE_LEVEL; MajorPlayer majorPlayer = PlayerManager.GetInstance().MajorPlayer; byte level = (byte)respond.nlevel; if (level != majorPlayer.level) { majorPlayer.level = level; majorPlayer.Exp = 0; KPlayerLevelExpSetting playerLevelExpSetting = KConfigFileManager.GetInstance().playerLevelSetting.getData((majorPlayer.level + 1).ToString()); majorPlayer.maxExp = playerLevelExpSetting.Exp; if (null != SceneLogic.GetInstance().MainHero) { AssetLoader.GetInstance().Load(URLUtil.GetEffectPath("effect_levelup"), LoadLevelUpComplete, AssetType.BINARY); //effect_levelup //SceneLogic.GetInstance().MainHero.TipsCmp.CreateTip( new Vector3(0,SceneLogic.GetInstance().MainHero.heroSetting.TipPos0,0), "+" + respond.addExp, "ExpFont","effect_ui_shuzitanchu_putong.res"); } EventDispatcher.GameWorld.Dispath(ControllerCommand.PLAYER_LEVEL_UP, level); } }