public void Start() { Application.RegisterLogCallback(HandleLog); MeshUtils.InitStaticValues(); CubeWorldPlayerPreferences.LoadPreferences(); PreferencesUpdated(); State = state = GameManagerUnityState.MAIN_MENU; mainMenu = new MainMenu(this); sectorManagerUnity = new SectorManagerUnity(this); objectsManagerUnity = new CWObjectsManagerUnity(this); fxManagerUnity = new CWFxManagerUnity(this); worldManagerUnity = new WorldManagerUnity(this); }
public void Update() { if (registerInWebServer) { RegisterInWebServer(); } switch (state) { case GameManagerUnityState.GENERATING: { if (worldManagerUnity.worldGeneratorProcess != null && worldManagerUnity.worldGeneratorProcess.IsFinished() == false) { worldManagerUnity.worldGeneratorProcess.Generate(); } else { worldManagerUnity.worldGeneratorProcess = null; PreferencesUpdated(); StartGame(); } break; } case GameManagerUnityState.PAUSE: case GameManagerUnityState.GAME: { if (world != null) { surroundingsUnity.UpdateSkyColor(); playerUnity.UpdateControlled(); world.Update(Time.deltaTime); UpdateAnimatedTexture(); } break; } } if (newState != state) { state = newState; } }
public void Unpause() { LockCursor(); State = GameManagerUnityState.GAME; }
public void Pause() { ReleaseCursor(); State = GameManagerUnityState.PAUSE; }
public void Update() { #if !UNITY_WEBPLAYER if (registerInWebServer) RegisterInWebServer(); #endif switch (state) { case GameManagerUnityState.GENERATING: { if (worldManagerUnity.worldGeneratorProcess != null && worldManagerUnity.worldGeneratorProcess.IsFinished() == false) { worldManagerUnity.worldGeneratorProcess.Generate(); } else { worldManagerUnity.worldGeneratorProcess = null; PreferencesUpdated(); StartGame(); } break; } case GameManagerUnityState.PAUSE: case GameManagerUnityState.GAME: { if (world != null) { surroundingsUnity.UpdateSkyColor(); playerUnity.UpdateControlled(); world.Update(Time.deltaTime); UpdateAnimatedTexture(); } break; } } if (newState != state) state = newState; }
public void ReturnToMainMenu() { DestroyWorld(); camera.enabled = true; State = GameManagerUnityState.MAIN_MENU; }
public void StartGame() { camera.enabled = false; LockCursor(); State = GameManagerUnityState.GAME; }