示例#1
0
 public override void Update(GameTime gameTime)
 {
     base.Update(gameTime);
     if (m_SceneChanges.ContainsKey(CurrentScene))
     {
         foreach (SceneChange sc in m_SceneChanges[CurrentScene])
         {
             if (sc.ChangeNow(gameTime))
             {
                 m_NextScene = sc.To;
                 if (CurrentScene != null)
                 {
                     CurrentScene.OnExit();
                     StopMainTune(m_NextScene);
                     CurrentScene.StopTune();
                 }
                 CurrentScene           = m_NextScene;
                 CurrentScene.StartTime = gameTime.TotalRealTime();
                 CurrentScene.Reset();
                 CurrentScene.OnEnter();
                 CurrentScene.StartTune();
                 StartMainTune();
             }
         }
     }
 }
示例#2
0
        internal static void Update()
        {
            CurrentScene?.Update();
            UpdateTransitions();

            if (DebugManager.Debugging && Input.KeyboardExt.Pressed(Keys.R))
            {
                CurrentScene?.OnEnter();
            }
        }
示例#3
0
 private static void LoadNextScene()
 {
     CurrentScene = NextScene;
     CurrentScene.OnEnter();
     NextScene = null;
 }