public void OnStartBattle() { // if(Obj_MyselfPlayer.GetMe().bInPvP) // { // NetworkSender.Instance().AskPVPBattleData(OnAskBattleDataRet // , Obj_MyselfPlayer.GetMe().pvpChoosePlayer.nlGUID // , Obj_MyselfPlayer.GetMe().pvpChoosePlayer.strName); // } // else // { // NetworkSender.Instance().AskBattleData(OnAskBattleDataRet, 1,Obj_MyselfPlayer.GetMe().curSubcopy.subCopyID); // } switch (Obj_MyselfPlayer.GetMe().battleType) { case Games.Battle.BattleType.PVE: NetworkSender.Instance().AskBattleData(OnAskBattleDataRet, 1, Obj_MyselfPlayer.GetMe().curSubcopy.subCopyID); break; case Games.Battle.BattleType.PVP: NetworkSender.Instance().AskPVPBattleData(OnAskBattleDataRet, Obj_MyselfPlayer.GetMe().pvpChoosePlayer.nlGUID, Obj_MyselfPlayer.GetMe().pvpChoosePlayer.strName); break; case Games.Battle.BattleType.CHONG_LOU: NetworkSender.Instance().AskChonglouBattleData(OnAskBattleDataRet); break; case Games.Battle.BattleType.WORLD_BOSS: ErrorEventListener.SetHandler((int)xjgame.message.ErrorType.WB_BATTLE_BOSS_DEAD, WorldBossError); ErrorEventListener.SetHandler((int)xjgame.message.ErrorType.WB_BATTLE_BOSS_HIDE, WorldBossError); NetworkSender.Instance().AskWorldBossBata(OnAskBattleDataRet); break; } }
void OnEnable() { if (mainController == null) { mainController = GameObject.Find("MainController").GetComponent <MainController>(); } ErrorEventListener.SetHandler((int)xjgame.message.ErrorType.WB_BATTLE_BOSS_DEAD, WorldBossError); ErrorEventListener.SetHandler((int)xjgame.message.ErrorType.WB_BATTLE_BOSS_HIDE, WorldBossError); GameObject.FindWithTag("main_controller").SendMessage("showBottomBar"); Obj_MyselfPlayer.GetMe().battleType = BattleType.WORLD_BOSS; mainController.ShowActivityTopUI(ActivityType.E_ACTIVITY_TYPE_WORLD_BOSS); activeBoss = Obj_MyselfPlayer.GetMe().activeBoss; lastKillInfo = Obj_MyselfPlayer.GetMe().lastKillInfo; currentKillInfo = Obj_MyselfPlayer.GetMe().currentKillInfo; nextTime = Obj_MyselfPlayer.GetMe().activeBossCD; battleCD = Obj_MyselfPlayer.GetMe().resurgenceCD; FreshResurgenceInfo(); FreshUI(); }