void Awake()
 {
     if (instance != null && instance != this)
     {
         Debug.LogError("More than one instances of MapLoadController on scene");
         Destroy(this);
     }
     else
     {
         instance = this;
     }
 }
Example #2
0
 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();
     }
 }
Example #3
0
 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();
             }
         }
     }
 }