ScreenManagement.Screens.LoadingScreen.Update C# (CSharp) 메소드

Update() 공개 메소드

Updates the loading screen.
public Update ( GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen ) : void
gameTime Microsoft.Xna.Framework.GameTime
otherScreenHasFocus bool
coveredByOtherScreen bool
리턴 void
        public override void Update(GameTime gameTime, bool otherScreenHasFocus,
                                                       bool coveredByOtherScreen)
        {
            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);

            transition += (float)gameTime.ElapsedGameTime.TotalSeconds;
            if (transition > 1)
                transition = 0;

            // If all the previous screens have finished transitioning
            // off, it is time to actually perform the load.
            if (otherScreensAreGone) {
                ScreenManager.RemoveScreen(this);

                foreach (GameScreen screen in screensToLoad) {
                    if (screen != null) {
                        ScreenManager.AddScreen(screen, ControllingPlayer);
                    }
                }

                // Once the load has finished, we use ResetElapsedTime to tell
                // the  game timing mechanism that we have just finished a very
                // long frame, and that it should not try to catch up.
                ScreenManager.Game.ResetElapsedTime();
            }
        }