Пример #1
0
    void SwitchPhase()
    {
        currentPhase = (currentPhase + 1) % 5;
        switch (currentPhase)
        {
        case 0:
            MultiplayerEventManager.TriggerAllowCurrentPlayerToMove(currentPlayer);
            break;

        case 1:
            MultiplayerEventManager.TriggerDisallowCurrentPlayerToMove(currentPlayer);
            break;

        case 2:
            MultiplayerEventManager.TriggerAllowCurrentPlayerToFire(currentPlayer);
            break;

        case 3:
            MultiplayerEventManager.TriggerDisallowCurrentPlayerToFire(currentPlayer);
            break;

        case 4:
            int lastPlayer = currentPlayer;
            NextPlayer();
            MultiplayerEventManager.TriggerNextPlayer(lastPlayer, currentPlayer);
            break;

        default:
            break;
        }
    }
Пример #2
0
 private void InstantiatePlayers()
 {
     deadPlayer = new bool[players.Length];
     for (int i = 0; i < players.Length; i++)
     {
         players [i] = Instantiate(players[i], spawnPoints[i], new Quaternion());
         players [i].GetComponent <MultiplayerPlayerId> ().SetId(i);
         deadPlayer [i] = false;
     }
     for (int i = 0; i < players.Length; i++)
     {
         MultiplayerEventManager.TriggerNextPlayer(currentPlayer, ((currentPlayer + 1) % players.Length));
         currentPlayer = (currentPlayer + 1) % players.Length;
     }
 }