public override void OnPlayerEnteredRoom(Player newPlayer) { Logger.Log("{0} joined the rumble", newPlayer.NickName); _player2Name.text = newPlayer.NickName; if (PhotonNetwork.IsMasterClient) { Logger.Log("Tell the client about the current game mode"); UpdateGameModeEvent updateGameModeEvent = new UpdateGameModeEvent(); updateGameModeEvent.SendUpdateGameModeEvent(GameRules.GameMode); } }
public void HandleInputValue(int currentValue) { if (currentValue == 0) { Logger.Log("Set game mode to Campaign"); GameRules.SetGameMode(GameMode.Campaign); } else if (currentValue == 1) { Logger.Log("Set game mode to Random Maze"); GameRules.SetGameMode(GameMode.RandomMaze); } else { Logger.Error($"Unknown game type value {currentValue}"); } UpdateGameModeEvent updateGameModeEvent = new UpdateGameModeEvent(); updateGameModeEvent.SendUpdateGameModeEvent(GameRules.GameMode); }