void Start()
 {
     if (currentGameMode)
     {
         chosenGameMode = (gameModes)currentGameMode.GetGameMode();
         if (PhotonNetwork.IsMasterClient)
         {
             photonView.RPC("UpdateGameMode", RpcTarget.All, chosenGameMode);
         }
     }
 }
Esempio n. 2
0
        public static GameMode setGameMode(gameModes gamemode)
        {
            GameMode gameMode;

            switch (gamemode)
            {
            case gameModes.PLAYING: gameMode = new GameModes.PlayingGameMode();
                break;

            default: throw new Exception("gameMode does not exist");
            }

            //Initialize the new GameMode
            gameMode.init();
            return(gameMode);
        }
 private void UpdateGameMode(gameModes gameMode)
 {
     chosenGameMode = gameMode;
     currentGameMode.OnGameModeChanged((int)gameMode);
 }