void SurvivalTankDeath(AccountData acc, AccountData enemy, Battle battle) { enemy.order = battle.GetALLTanks().Count; battle.RemoveTank(enemy.account); //发给单个人的战斗数据 NotifyBattleEnd notifyEnd = new NotifyBattleEnd(); TankKillData kill = new TankKillData(); kill.account = enemy.account; kill.kill = enemy.killCount; kill.deathCount = enemy.deathCount; kill.hurt = enemy.hurt; kill.order = enemy.order; notifyEnd.data = kill; NetworkManager.Send <NotifyBattleEnd>(enemy.token, (int)MsgID.NotifyBattleEnd, notifyEnd); enemy.killCount = 0; enemy.deathCount = 0; enemy.hurt = 0; enemy.order = -1; //游戏结束 if (battle.GetALLTanks().Count == 1) { NotifyBattleEnd notifyEnd2 = new NotifyBattleEnd(); TankKillData kill2 = new TankKillData(); kill2.account = acc.account; kill2.kill = acc.killCount; kill2.deathCount = acc.deathCount; kill2.hurt = acc.hurt; kill2.order = 1; notifyEnd2.data = kill2; NetworkManager.Send <NotifyBattleEnd>(acc.token, (int)MsgID.NotifyBattleEnd, notifyEnd2); enemy.killCount = 0; enemy.deathCount = 0; enemy.hurt = 0; enemy.order = -1; } }
private void OnNotifyBattleEnd(SocketModel model) { NotifyBattleEnd notify = SerializeUtil.Deserialize <NotifyBattleEnd>(model.message); UIManager.instance.Open <BattleEndWindow>().Init(notify.data); }