// SCENERY CHANGING public static void StartNewGame(GameStartSettings gss) { if (realMaster == null) { _applyingGameStartSettings = gss; ChangeScene(PLAY_SCENE_INDEX); } else { if (gss.NeedLoading()) { realMaster.gameMode = gss.DefineGameMode(); realMaster.LoadGame(gss.GetSavenameFullpath()); } else { realMaster.ClearPreviousSessionData(); _applyingGameStartSettings = gss; realMaster.Awake(); realMaster.PrepareSession(); } } }
// private void Awake() { gameRules = GameRules.defaultRules; if (testMode && test_gameStartSettings != null) { _applyingGameStartSettings = test_gameStartSettings; test_gameStartSettings = null; } if (_applyingGameStartSettings == null && startSettings == null) { _applyingGameStartSettings = GameStartSettings.GetDefaultStartSettings(); } if (startSettings == null) { startSettings = _applyingGameStartSettings; _applyingGameStartSettings = null; } gameMode = startSettings.DefineGameMode(); if (gameMode == GameMode.MainMenu) { Destroy(gameObject); return; } if (realMaster != null & realMaster != this) { Destroy(realMaster); realMaster = this; return; } realMaster = this; sceneClearing = false; // uicontroller = UIController.GetCurrent(); // if (PoolMaster.current == null) { PoolMaster pm = gameObject.AddComponent(typeof(PoolMaster)) as PoolMaster; pm.Load(); } if (gameMode == GameMode.Survival) { globalMap = InitializeGlobalMap(); } if (environmentMaster == null) { environmentMaster = new GameObject("Environment master").AddComponent <EnvironmentMaster>(); } environmentMaster.Prepare(); if (audiomaster == null) { audiomaster = gameObject.AddComponent <Audiomaster>(); audiomaster.Prepare(); } if (geologyModule == null) { geologyModule = gameObject.AddComponent <GeologyModule>(); } Screen.sleepTimeout = SleepTimeout.NeverSleep; }