Ejemplo n.º 1
0
        public void Update(GameTime gameTime)
        {
            UpdateTime(gameTime);

            if (Loading)
            {
                LoadingProgressBarAlpha += gameTime.ElapsedGameTime.Milliseconds * 60 / 100000f;
                if (LoadingProgressBarAlpha > 1)
                {
                    LoadingProgressBarAlpha = 1;
                }
                return;
            }
            if (LoadingProgressBarAlpha > 0)
            {
                LoadingProgressBarAlpha -= gameTime.ElapsedGameTime.Milliseconds * 60 / 100000f;
                if (LoadingProgressBarAlpha < 0)
                {
                    LoadingProgressBarAlpha = 0;
                }
            }

            if (MyScene != null)
            {
#if EDITOR && WINDOWS
                if (LevelForEditing)
                {
                    MyScene.UpdateEditor(gameTime);
                }
                else if (true)
#endif
                MyScene.Update(gameTime);

                if (MyScene.NeedsPlayers)
                {
                    PlayerProfile.CallLevelEvents();
                    MyScene.NeedsPlayers = false;
                }
            }

            PlayerProfile.Update(gameTime, AllowJoining);
        }