Simulation mode and pause/resume

This commit is contained in:
Simon Lübeß
2023-03-24 23:50:46 +01:00
parent f16fbc3984
commit d54cdf43ee
5 changed files with 150 additions and 18 deletions
+16 -1
View File
@@ -125,6 +125,16 @@ namespace GlitchyEngine.World
}
public void OnRuntimeStart()
{
OnSimulationStart();
}
public void OnRuntimeStop()
{
OnSimulationStop();
}
public void OnSimulationStart()
{
_physicsWorld2D = Box2D.World.Create(ref _gravity2D);
@@ -183,7 +193,7 @@ namespace GlitchyEngine.World
}
}
public void OnRuntimeStop()
public void OnSimulationStop()
{
Box2D.World.Delete(_physicsWorld2D);
_physicsWorld2D = null;
@@ -191,8 +201,13 @@ namespace GlitchyEngine.World
public enum UpdateMode
{
/// No special update configuration (this does NOT mean nothing will be updated!)
None = 0x00,
/// Update editor-specific stuff
Editor = 0x01,
/// Update the physics related stuff
Physics = 0x02,
/// Update the runtume related stuff (e.g. execute scripts). Also run physics!
Runtime = 0x04 | Physics,
}