refactor: switched from universe objects to behaviours on all managers like update, draw & physics etc.

This commit is contained in:
2025-06-03 23:59:40 +03:00
parent 24d1a1d764
commit beecefec1c
6 changed files with 23 additions and 23 deletions

View File

@@ -4,7 +4,7 @@ using Syntriax.Engine.Core;
namespace Syntriax.Engine.Physics2D;
public class PhysicsEngine2D : UniverseObject, IPhysicsEngine2D
public class PhysicsEngine2D : Behaviour, IPhysicsEngine2D
{
public Event<IPhysicsEngine2D, float> OnPhysicsIteration { get; } = new();
public Event<IPhysicsEngine2D, float> OnPhysicsStep { get; } = new();
@@ -174,7 +174,7 @@ public class PhysicsEngine2D : UniverseObject, IPhysicsEngine2D
rigidBody.Transform.Rotation += rigidBody.AngularVelocity * intervalDeltaTime;
}
protected override void OnEnteringUniverse(IUniverse universe)
protected override void OnEnteredUniverse(IUniverse universe)
{
physicsPreUpdateCollector.Assign(universe);
physicsUpdateCollector.Assign(universe);
@@ -185,7 +185,7 @@ public class PhysicsEngine2D : UniverseObject, IPhysicsEngine2D
universe.OnPreUpdate.AddListener(OnEnginePreUpdate);
}
protected override void OnExitingUniverse(IUniverse universe)
protected override void OnExitedUniverse(IUniverse universe)
{
physicsPreUpdateCollector.Unassign();
physicsUpdateCollector.Unassign();