void Awake() { if (instance != null && instance != this) { Debug.LogError("More than one instances of MapLoadController on scene"); Destroy(this); } else { instance = this; } }
public void StartGame() { if (MapLoadController.CheckMap(MultiplayerController.Instance.MapName)) { MultiplayerController.Instance.StartingGold = LobbyMenuController.StartingGold; MultiplayerController.Instance.StartingLumber = LobbyMenuController.StartingLumber; NetworkServer.Destroy(LobbyMenuController.gameObject); MultiplayerController.Instance.StartGame(); } else { LobbyMenuController.Instance.ShowMapErrorMessage(); } }
public override void OnServerReady(NetworkConnection conn) { base.OnServerReady(conn); if (SceneManager.GetActiveScene().name == gameSceneName) { ++readyClientsOnGameScene; if (readyClientsOnGameScene == 2) { if (MapLoadController.CheckMap(MultiplayerController.Instance.MapName)) { MapLoadController.Instance.LoadChosenMap(); MultiplayerController.Instance.RpcInitializeGame(); } else { LobbyMenuController.Instance.ShowMapErrorMessage(); } } } }