예제 #1
0
        protected override void Dispose(bool disposing)
        {
            TitleScreen.Dispose();
            GameConfigurationScreen.Dispose();
            GameplayScreen.Dispose();
            LeaderboardScreen.Dispose();
            ImprovementScreen.Dispose();
            GameOverScreen.Dispose();
            OptionsScreen.Dispose();
            KeyboardInputsScreen.Dispose();
            GamepadInputsScreen.Dispose();

            _stateManager.Dispose();
            SpriteBatch.Dispose();

            StaticClassSerializer.Save(typeof(PlayerData), "data.bin");

            base.Dispose(disposing);
        }
예제 #2
0
 public void Dispose()
 {
     if (BoxFront != null)
     {
         try
         { BoxFront.Dispose(); }
         catch { }
         BoxFront = null;
     }
     if (BoxBack != null)
     {
         try
         { BoxBack.Dispose(); }
         catch { }
         BoxBack = null;
     }
     if (TitleScreen != null)
     {
         try
         { TitleScreen.Dispose(); }
         catch { }
         TitleScreen = null;
     }
     if (InGame != null)
     {
         try
         { InGame.Dispose(); }
         catch { }
         InGame = null;
     }
     if (Fanart != null)
     {
         try
         { Fanart.Dispose(); }
         catch { }
         Fanart = null;
     }
 }