From 03498b4854892923810df8052efca98f3d6d57a1 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sun, 19 May 2024 13:01:42 -0700 Subject: [PATCH] perf: Made all tileset file's generated sprites+tiles hideFlags to HideInHierarchy to fix ProjectBrowser.Repaint taking a long time to load while large tileset files are collapsed in the project window after a recompile or other various events --- .../LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs index 42b454cf..4e9df726 100644 --- a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs +++ b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs @@ -228,6 +228,7 @@ private LDtkArtifactAssetsTileset MakeAndCacheArtifacts(TextureGenerationOutput { LDtkProfiler.BeginSample("AddTile"); Sprite spr = output.sprites[i]; + spr.hideFlags = HideFlags.HideInHierarchy; ImportContext.AddObjectToAsset(spr.name, spr); LDtkProfiler.EndSample(); @@ -250,7 +251,7 @@ private LDtkArtifactAssetsTileset MakeAndCacheArtifacts(TextureGenerationOutput newTilesetTile._sprite = spr; newTilesetTile._type = GetColliderTypeForSprite(spr); newTilesetTile._tileId = i; - newTilesetTile.hideFlags = HideFlags.None; + newTilesetTile.hideFlags = HideFlags.HideInHierarchy; if (customData.TryGetValue(i, out string cd)) { newTilesetTile._customData = cd;