Skip to content
This repository was archived by the owner on May 9, 2025. It is now read-only.

Commit f2033e2

Browse files
Added min distance to event debug entries
1 parent 01b4dae commit f2033e2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Assets/SO Architecture/Events/Listeners/BaseGameEventListener.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public abstract class DebuggableGameEventListener : SOArchitectureBaseMonobehavi
9797
private const float DOT_LENGTH = 0.5f;
9898
private const float DOT_WIDTH = 3;
9999
private const float EVENT_MOVEMENT_SPEED = 3;
100+
private const float EVENT_MIN_DISTANCE = 0.3f;
100101

101102
protected abstract ScriptableObject GameEvent { get; }
102103
protected abstract UnityEventBase Response { get; }
@@ -132,6 +133,10 @@ protected void CreateDebugEntry(UnityEventBase response)
132133
for (int i = 0; i < response.GetPersistentEventCount(); i++)
133134
{
134135
GameObject gameObjectTarget = GetGameObject(response.GetPersistentTarget(i));
136+
137+
if (Vector3.Distance(gameObject.transform.position, gameObjectTarget.transform.position) <= EVENT_MIN_DISTANCE)
138+
continue;
139+
135140
string targetName = gameObject ? gameObject.name : "Null";
136141

137142
string functionName = string.Format("{0} ({1})", targetName, response.GetPersistentMethodName(i));

0 commit comments

Comments
 (0)