public void ChangeScreen(string newScreen) { // UnLoad(); currentScreen = null; switch (newScreen) { case "StartScreen": currentScreen = startScreen; //new StartScreen(); break; case "MainGameScreen": if (gameScreen == null) { gameScreen = new MainGameScreen(); } currentScreen = gameScreen; //new MainGameScreen(); break; case "Exit": exitGame = true; return; } GC.Collect(); currentScreen.Init(); currentScreen.Load(); }
public GameManager() { //GameScreen //currentScreen = new MainGameScreen(); //StartScreen startScreen = new StartScreen(); currentScreen = startScreen; }