public void Shutdown() { lock (lockObj) { NextScene = null; CurrentScene?.Close(); CurrentScene = null; } }
public void Update(GameTime gameTime) { Performance.Push("Game loop"); InputManager.UpdateInput(gameTime); lock (lockObj) { if (NextScene != null) { if (CurrentScene != null) { CurrentScene.Close(); } CurrentScene = NextScene; if (CurrentScene != null) { CurrentScene.Init(this); } NextScene = null; } if (CurrentScene != null) { if (CurrentScene.MouseCursor != null) { CurrentScene.MouseCursor.Position = InputManager.MousePosition; } CurrentScene.Update(gameTime); } } Performance.Pop(); }