mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 20:58:34 +01:00
added DoUpdate to MlemGame
This commit is contained in:
parent
0c74dfc38e
commit
f86944ee9a
3 changed files with 10 additions and 8 deletions
|
@ -79,8 +79,8 @@ namespace Demos {
|
||||||
base.DoDraw(gameTime);
|
base.DoDraw(gameTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update(GameTime gameTime) {
|
protected override void DoUpdate(GameTime gameTime) {
|
||||||
base.Update(gameTime);
|
base.DoUpdate(gameTime);
|
||||||
if (this.activeDemo != null)
|
if (this.activeDemo != null)
|
||||||
this.activeDemo.Update(gameTime);
|
this.activeDemo.Update(gameTime);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,12 +40,10 @@ namespace MLEM.Startup {
|
||||||
this.OnLoadContent?.Invoke(this);
|
this.OnLoadContent?.Invoke(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update(GameTime gameTime) {
|
protected sealed override void Update(GameTime gameTime) {
|
||||||
base.Update(gameTime);
|
|
||||||
|
|
||||||
this.InputHandler.Update();
|
this.InputHandler.Update();
|
||||||
|
this.DoUpdate(gameTime);
|
||||||
this.UiSystem.Update(gameTime);
|
this.UiSystem.Update(gameTime);
|
||||||
|
|
||||||
this.OnUpdate?.Invoke(this, gameTime);
|
this.OnUpdate?.Invoke(this, gameTime);
|
||||||
CoroutineHandler.Tick(gameTime.GetElapsedSeconds());
|
CoroutineHandler.Tick(gameTime.GetElapsedSeconds());
|
||||||
CoroutineHandler.RaiseEvent(CoroutineEvents.Update);
|
CoroutineHandler.RaiseEvent(CoroutineEvents.Update);
|
||||||
|
@ -63,6 +61,10 @@ namespace MLEM.Startup {
|
||||||
base.Draw(gameTime);
|
base.Draw(gameTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual void DoUpdate(GameTime gameTime) {
|
||||||
|
base.Update(gameTime);
|
||||||
|
}
|
||||||
|
|
||||||
public static T LoadContent<T>(string name) {
|
public static T LoadContent<T>(string name) {
|
||||||
return instance.Content.Load<T>(name);
|
return instance.Content.Load<T>(name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,8 +59,8 @@ namespace Sandbox {
|
||||||
this.UiSystem.Add("Panel", panel);*/
|
this.UiSystem.Add("Panel", panel);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update(GameTime gameTime) {
|
protected override void DoUpdate(GameTime gameTime) {
|
||||||
base.Update(gameTime);
|
base.DoUpdate(gameTime);
|
||||||
if (this.InputHandler.IsKeyPressed(Keys.F11))
|
if (this.InputHandler.IsKeyPressed(Keys.F11))
|
||||||
this.GraphicsDeviceManager.SetFullscreen(!this.GraphicsDeviceManager.IsFullScreen);
|
this.GraphicsDeviceManager.SetFullscreen(!this.GraphicsDeviceManager.IsFullScreen);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue