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()); }