示例#1
0
        private void HandleServerEventKillDeathCountChangeEvent(KillDeathCountChange message)
        {
            if (message.VictimPeer == null)
            {
                return;
            }
            MissionPeer         component    = message.VictimPeer.GetComponent <MissionPeer>();
            NetworkCommunicator attackerPeer = message.AttackerPeer;
            MissionPeer         killedPeer   = attackerPeer != null?attackerPeer.GetComponent <MissionPeer>() : (MissionPeer)null;

            if (component != null)
            {
                component.KillCount   = message.KillCount;
                component.AssistCount = message.AssistCount;
                component.DeathCount  = message.DeathCount;
                component.Score       = message.Score;
                component.OnKillAnotherPeer(killedPeer);
                if (message.KillCount == 0 && message.AssistCount == 0 && (message.DeathCount == 0 && message.Score == 0))
                {
                    component.ResetKillRegistry();
                }
            }
            if (this._missionScoreboardComponent == null)
            {
                return;
            }
            this._missionScoreboardComponent.PlayerPropertiesChanged(message.VictimPeer);
        }