Skip to content

Commit 9ada5d4

Browse files
committed
fix: Verbose log will properly log when tilemaps are refreshed even if the scene window doesn't exist
1 parent 1e6960c commit 9ada5d4

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

Assets/LDtkUnity/Editor/Utility/LDtkTilemapColliderReset.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Diagnostics;
1+
using System;
2+
using System.Diagnostics;
23
using System.Linq;
34
using UnityEditor;
45
using UnityEngine;
@@ -57,17 +58,19 @@ public static void TilemapColliderTileUpdate()
5758
}
5859
}
5960
watch.Stop();
60-
61+
62+
float seconds = watch.ElapsedMilliseconds * 0.001f;
6163
SceneView view = SceneView.lastActiveSceneView;
62-
if (view != null && affected > 0)
64+
string msg = $"Refreshed LDtk scene tilemaps\n({affected} in {seconds:F2}s)";
65+
66+
if (view != null)
6367
{
64-
float seconds = watch.ElapsedMilliseconds * 0.001f;
65-
string msg = $"Refreshed LDtk scene tilemaps\n({affected} in {seconds:F2}s)";
6668
view.ShowNotification(new GUIContent(msg), 2.5f);
67-
if (LDtkPrefs.VerboseLogging)
68-
{
69-
Debug.Log(msg);
70-
}
69+
}
70+
71+
if (LDtkPrefs.VerboseLogging)
72+
{
73+
LDtkDebug.Log(msg);
7174
}
7275
};
7376
}

0 commit comments

Comments
 (0)