Example #1
0
 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();
     }
 }
Example #2
0
        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;
        }
Example #3
0
 public void LoadScene(string sceneName)
 {
     nextSceneToLoad = scenes[sceneName];
 }
Example #4
0
 public void RemoveScene(AbstractScene scene)
 {
     scenes.Remove(scene.GetName());
 }
Example #5
0
 public void SetLoadingScene(AbstractScene loadingScene)
 {
     this.loadingScreen = loadingScene;
 }
Example #6
0
 public void LoadScene(AbstractScene scene)
 {
     LoadScene(scene.GetName());
 }
Example #7
0
 public void StartScene(AbstractScene scene)
 {
     StartScene(scene.GetName());
 }
Example #8
0
 public void StartScene(string sceneName)
 {
     nextSceneToStart = scenes[sceneName];
 }