private void UpdateSceneLoadUnload() { ScenarioManager.LoadState loadState = this.m_LoadState; if (loadState != ScenarioManager.LoadState.UnloadingScenes) { if (loadState != ScenarioManager.LoadState.LoadingScenes) { return; } if (!SceneLoadUnloadRequestHolder.Get().IsAnyRequest(SceneLoadUnloadRequest.Reason.SavegameLoad, SceneLoadUnloadRequest.OpType.Load, "")) { MainLevel.Instance.InitObjects(); this.m_Scenario = new Scenario(); this.m_Scenario.LoadScript(); this.m_Scenario.SetupParents(); this.m_Scenario.SetupNodes(); this.m_Scenario.Load(); this.ClearObjectCache(); this.m_LoadState = ScenarioManager.LoadState.LoadingCompleted; } } else if (!SceneLoadUnloadRequestHolder.Get().IsAnyRequest(SceneLoadUnloadRequest.Reason.SavegameLoad, SceneLoadUnloadRequest.OpType.Unload, "")) { foreach (string scene_name in this.m_ScenesToLoad) { SceneLoadUnloadRequestHolder.Get().LoadScene(scene_name, SceneLoadUnloadRequest.Reason.SavegameLoad); } this.m_LoadState = ScenarioManager.LoadState.LoadingScenes; return; } }
public void UnloadScene(string scene_name) { if (!GreenHellGame.Instance.m_ScenarioScenes.Contains(scene_name) && MainLevel.Instance.GetStreamers().Count > 0) { global::Logger.LogWarning("UnloadScene called for non-scenario scene! This will have no result."); return; } SceneLoadUnloadRequestHolder.Get().UnloadScene(scene_name, SceneLoadUnloadRequest.Reason.Scenario); }
public void Load() { this.m_ScenesToLoad.Clear(); int num = SaveGame.LoadIVal("ScenesCount"); for (int i = 0; i < num; i++) { string item = SaveGame.LoadSVal("Scene" + i); this.m_ScenesToLoad.Add(item); } this.m_LoadState = ScenarioManager.LoadState.UnloadingScenes; foreach (string scene_name in GreenHellGame.Instance.m_ScenarioScenes) { SceneLoadUnloadRequestHolder.Get().UnloadScene(scene_name, SceneLoadUnloadRequest.Reason.SavegameLoad); } }
public bool IsSceneLoading() { return(SceneLoadUnloadRequestHolder.Get().IsLoadingUnloadingScenes()); }
private bool IsValidSceneToSave(string scene_name) { return(!(scene_name == "Terrain") && !scene_name.Contains("assets") && !SceneLoadUnloadRequestHolder.Get().IsAnyRequest(SceneLoadUnloadRequest.Reason.Any, SceneLoadUnloadRequest.OpType.Unload, scene_name)); }