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(); } } } }
internal static void Update() { CurrentScene?.Update(); UpdateTransitions(); if (DebugManager.Debugging && Input.KeyboardExt.Pressed(Keys.R)) { CurrentScene?.OnEnter(); } }
private static void LoadNextScene() { CurrentScene = NextScene; CurrentScene.OnEnter(); NextScene = null; }