public void AddScene(AbstractScene scene) { if (scenes.ContainsKey(scene.GetName())) { throw new Exception("Scene name already exists!"); } scenes.Add(scene.GetName(), scene); scene.Camera = camera; scene.SetSceneManager(this); if (scene.Preload) { scene.InternalLoad(); } }
private void StartNextScene() { ICollection <object> data = null; if (currentScene != null) { data = currentScene.ExportData(); currentScene.OnEnd(); if (!currentScene.AlwaysActive) { activeScenes.RemoveIfExists(currentScene); } } currentScene = nextSceneToStart; nextSceneToStart = null; activeScenes.AddIfMissing(currentScene); currentScene.ImportData(data); currentScene.OnStart(); isLoading = false; useLoadingScreen = false; }
public void LoadScene(string sceneName) { nextSceneToLoad = scenes[sceneName]; }
public void RemoveScene(AbstractScene scene) { scenes.Remove(scene.GetName()); }
public void SetLoadingScene(AbstractScene loadingScene) { this.loadingScreen = loadingScene; }
public void LoadScene(AbstractScene scene) { LoadScene(scene.GetName()); }
public void StartScene(AbstractScene scene) { StartScene(scene.GetName()); }
public void StartScene(string sceneName) { nextSceneToStart = scenes[sceneName]; }