Example #1
0
 private void ResetScene(BindState state)
 {
     if (state == BindState.Pressed)
     {
         ScrollerSerializer.ReloadEntities();
         this.GetGameState <SceneManager>().ReloadScenes("", true);
     }
 }
Example #2
0
 private void ResetSceneAtPosition(BindState state)
 {
     if (state == BindState.Pressed)
     {
         var oldPosition = Vector2.Zero;
         foreach (var player in this.Players)
         {
             if (!player.Character.IsDisposed)
             {
                 oldPosition = player.Character.Position;
                 break;
             }
         }
         ScrollerSerializer.ReloadEntities();
         this.GetGameState <SceneManager>().ReloadScenes("", true);
         if (oldPosition != Vector2.Zero)
         {
             foreach (var player in this.Players)
             {
                 player.Character.Position = oldPosition;
             }
         }
     }
 }