protected override IEnumerator Init() { NetworkClient nc = CustomNetworkManager.AddPlayer(); if (nc != null) { TerrainController tc = GameObject.FindObjectOfType <TerrainController>(); if (tc != null) { yield return(tc.GenerateTerrain(LoadingPanel.OnProgress)); } tc.CreateLight(); if (Parent != null) { Parent.Activate <GameState_Play>(); } } else { nc.Disconnect(); CustomNetworkManager.Stop(); Deactivate <GameState_AddPlayer>(); } yield return(base.Init()); }
protected override IEnumerator Init() { GUIContainer.LoadingPanel.gameObject.SetActive(true); if (CustomNetworkManager.RunServer() != null) { TerrainController tc = GameObject.FindObjectOfType <TerrainController>(); yield return(tc.GenerateTerrain(LoadingPanel.OnProgress)); tc.CreateLight(); } if (Parent != null) { Parent.Activate <GameState_Play>(); } yield return(base.Init()); }