From ef347320fde82e6ee072f27aecf389e0dfee4ff5 Mon Sep 17 00:00:00 2001 From: Syntriax Date: Sun, 28 Jan 2024 15:33:15 +0300 Subject: [PATCH] feat: Circle & Shape Behaviours IsActive Check --- Game/Behaviours/CircleBehaviour.cs | 3 +++ Game/Behaviours/ShapeBehaviour.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Game/Behaviours/CircleBehaviour.cs b/Game/Behaviours/CircleBehaviour.cs index eed56f6..783dccb 100644 --- a/Game/Behaviours/CircleBehaviour.cs +++ b/Game/Behaviours/CircleBehaviour.cs @@ -18,6 +18,9 @@ public class CircleBehaviour : Syntriax.Engine.Physics2D.Collider2DCircleBehavio public void Draw(ShapeBatch shapeBatch) { + if (!IsActive) + return; + Recalculate(); shapeBatch.BorderCircle(CircleWorld.Center.ToDisplayVector2(), CircleWorld.Radius, Color); diff --git a/Game/Behaviours/ShapeBehaviour.cs b/Game/Behaviours/ShapeBehaviour.cs index 568042d..3417909 100644 --- a/Game/Behaviours/ShapeBehaviour.cs +++ b/Game/Behaviours/ShapeBehaviour.cs @@ -18,6 +18,9 @@ public class ShapeBehaviour : Syntriax.Engine.Physics2D.Collider2DShapeBehaviour public void Draw(ShapeBatch shapeBatch) { + if (!IsActive) + return; + Recalculate(); int count = ShapeWorld.Vertices.Count;