コード例 #1
0
        public override void OnGameMessage(GameMessage message)
        {
            UpdateTeamRoster updateTeams = message as UpdateTeamRoster;

            if (updateTeams != null)
            {
                if (clientManager.OnUpdateTeamRoster != null)
                {
                    clientManager.OnUpdateTeamRoster(updateTeams.RedTeam, updateTeams.BlueTeam);
                }
                return;
            }

            MatchCountdownStarted countdownStarted = message as MatchCountdownStarted;

            if (countdownStarted != null)
            {
                if (clientManager.OnMatchCountdownStarted != null)
                {
                    clientManager.OnMatchCountdownStarted(countdownStarted.Delay);
                }
            }

            GamePlayStarted gameStarted = message as GamePlayStarted;

            if (gameStarted != null)
            {
                if (clientManager.LoadPrefabs() && clientManager.Spawn())
                {
                    //clientManager.NetworkManager.PlayerSpawned();
                    clientManager.ChangeState(clientManager.ClientGamePlayState, gameStarted);
                }
            }
        }
コード例 #2
0
        public override void OnStateMessage(StateMessage message)
        {
            OnEnterState enter = message as OnEnterState;

            if (enter != null)
            {
                GamePlayStarted started = enter.Message as GamePlayStarted;
                if (started != null && clientManager.OnMatchStarted != null)
                {
                    if (clientManager.OnGameDrivenEvent != null)
                    {
                        clientManager.OnGameDrivenEvent(LogEventMessages.EVENT_MATCH_STARTED);
                        CAudioControl.CreateAndPlayAudio(Vector3.zero, Audio.AUDIO_MUSIC, true, true, false, 0.6f);
                    }
                    clientManager.OnMatchStarted(started.Delay);
                }
                return;
            }
        }