feat: Circle & Shape Behaviours IsActive Check

This commit is contained in:
Syntriax 2024-01-28 15:33:15 +03:00
parent 1207d04d50
commit ef347320fd
2 changed files with 6 additions and 0 deletions

View File

@ -18,6 +18,9 @@ public class CircleBehaviour : Syntriax.Engine.Physics2D.Collider2DCircleBehavio
public void Draw(ShapeBatch shapeBatch) public void Draw(ShapeBatch shapeBatch)
{ {
if (!IsActive)
return;
Recalculate(); Recalculate();
shapeBatch.BorderCircle(CircleWorld.Center.ToDisplayVector2(), CircleWorld.Radius, Color); shapeBatch.BorderCircle(CircleWorld.Center.ToDisplayVector2(), CircleWorld.Radius, Color);

View File

@ -18,6 +18,9 @@ public class ShapeBehaviour : Syntriax.Engine.Physics2D.Collider2DShapeBehaviour
public void Draw(ShapeBatch shapeBatch) public void Draw(ShapeBatch shapeBatch)
{ {
if (!IsActive)
return;
Recalculate(); Recalculate();
int count = ShapeWorld.Vertices.Count; int count = ShapeWorld.Vertices.Count;