Skip to content

Commit

Permalink
fix: Verbose log will properly log when tilemaps are refreshed even i…
Browse files Browse the repository at this point in the history
…f the scene window doesn't exist
  • Loading branch information
Cammin committed Dec 1, 2024
1 parent 1e6960c commit 9ada5d4
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Assets/LDtkUnity/Editor/Utility/LDtkTilemapColliderReset.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System;
using System.Diagnostics;
using System.Linq;
using UnityEditor;
using UnityEngine;
Expand Down Expand Up @@ -57,17 +58,19 @@ public static void TilemapColliderTileUpdate()
}
}
watch.Stop();


float seconds = watch.ElapsedMilliseconds * 0.001f;
SceneView view = SceneView.lastActiveSceneView;
if (view != null && affected > 0)
string msg = $"Refreshed LDtk scene tilemaps\n({affected} in {seconds:F2}s)";

if (view != null)
{
float seconds = watch.ElapsedMilliseconds * 0.001f;
string msg = $"Refreshed LDtk scene tilemaps\n({affected} in {seconds:F2}s)";
view.ShowNotification(new GUIContent(msg), 2.5f);
if (LDtkPrefs.VerboseLogging)
{
Debug.Log(msg);
}
}

if (LDtkPrefs.VerboseLogging)
{
LDtkDebug.Log(msg);
}
};
}
Expand Down

0 comments on commit 9ada5d4

Please sign in to comment.