示例#1
0
 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);
 }
示例#2
0
 public void SetActiveScene(SceneType sceneType)
 {
     previousScenes.Push(ActiveScene);
     ActiveScene = scenes[sceneType];
 }
示例#3
0
 public void AddScene(SceneType sceneType, Scene scene)
 {
     scene.Enabled = false;
     scene.SwitchScene += OnSwitchScene;
     scenes[sceneType] = scene;
 }