private LoadingScreen(ScreenManager screenManager, bool loadingIsSlow, GameScreen[] screensToLoad) { this.loadingIsSlow = loadingIsSlow; this.screensToLoad = screensToLoad; TransitionOnTime = TimeSpan.FromSeconds(0.5); }
// Add screens to screenManager public void AddScreen(GameScreen screen, PlayerIndex? controllingPlayer) { screen.ControllingPlayer = controllingPlayer; screen.ScreenManager = this; screen.IsExiting = false; if (isInitialized) { screen.Activate(false); screen.LoadContent(); } screens.Add(screen); }
// Remove screen from sceneManager public void RemoveScreen(GameScreen screen) { if (isInitialized) { screen.Unload(); } screens.Remove(screen); tempScreenList.Remove(screen); }