コード例 #1
0
ファイル: ScreenManager.cs プロジェクト: rgee/Skyblocks
        /// <summary>
        /// Add a screen to the screen manager.
        /// </summary>
        /// <param name="screen"></param>
        /// <param name="controllingPlayer"></param>
        public void AddScreen(GameScreen screen, PlayerIndex? controllingPlayer)
        {
            screen.ControllingPlayer = controllingPlayer;
            screen.ScreenManager = this;
            screen.IsExiting = false;

            if (isInitialized)
            {
                screen.LoadContent();
            }

            screens.Add(screen);
        }
コード例 #2
0
ファイル: ScreenManager.cs プロジェクト: rgee/Skyblocks
        /// <summary>
        /// INSTANTLY remove a game screen from the screen manager. NO TRANSITION.
        /// </summary>
        /// <param name="screen"></param>
        public void RemoveScreen(GameScreen screen)
        {
            if (isInitialized)
            {
                screen.UnloadContent();
            }

            screens.Remove(screen);
            screensToUpdate.Remove(screen);
        }