public override void Update(GameTime gameTime) { // Back button functionality if (PlayerPressedBackButton()) { if (ThereArePreviousScenes()) ActiveScene = previousScenes.Pop(); else Game.Exit(); //TODO Clean up before exist else error in set } // updates the activeScene only activeScene.Update(gameTime); base.Update(gameTime); }
public void SetActiveScene(SceneType sceneType) { previousScenes.Push(ActiveScene); ActiveScene = scenes[sceneType]; }
public void AddScene(SceneType sceneType, Scene scene) { scene.Enabled = false; scene.SwitchScene += OnSwitchScene; scenes[sceneType] = scene; }