コード例 #1
0
 public override void OnPreGame()
 {
     GameStats.CreateNewIntegerStat("Kills");
     GameStats.CreateNewIntegerStat("Flags");
     for (int i = 0; i < isFlagAtBase.Length; i++)
     {
         isFlagAtBase[i] = true;
     }
 }
コード例 #2
0
    public void ChangeGameState(GameState state)
    {
        CurrentGameState = state;
        switch (state)
        {
        case GameState.PRE_GAME:
            GameStats.ClearAllStats();

            if (BoltNetwork.isServer)
            {
                CurrentPlayerStatIndex = ServerConnectionEventListener.IndexMap.GetIndexForPlayer(CurrentUserName);
                Debug.Log("CurrentPlayerStatIndex=" + CurrentPlayerStatIndex);
                GameStats.CreateNewStringStat("Player");
                var map = ServerConnectionEventListener.IndexMap;
                for (int i = 0; i < map.PlayerCount; i++)
                {
                    GameStats.SetStringStat(i, "Player", map.GetPlayerNameForIndex(i));
                }
                if (gameMode.UsesTeams)
                {
                    GameStats.CreateNewIntegerStat("Team");
                    var lookup = Lobby.GetTeamLookup();
                    foreach (var pair in lookup)
                    {
                        GameStats.SetIntegerStat(pair.Key, "Team", pair.Value);
                    }
                }
                gameMode.OnPreGame();
            }
            else
            {
                CurrentPlayerStatIndex = Lobby.GetStatIndexForPlayer(CurrentUserName);
            }
            break;

        case GameState.IN_GAME:
            if (BoltNetwork.isServer)
            {
                gameMode.OnGameStart();
            }
            break;
        }
        if (BoltNetwork.isServer)
        {
            ServerSideData.UpdateZeusData();
        }
    }
コード例 #3
0
 public override void OnPreGame()
 {
     GameStats.CreateNewIntegerStat("Kills");
 }