diff --git a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs index 36b2f099..1cb5c57d 100644 --- a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs +++ b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs @@ -35,6 +35,7 @@ internal sealed partial class LDtkTilesetImporter : LDtkJsonImporter /// Holds onto all the standard grid-sized tiles. This serializes the sprite's changed settings between reimports, like pivot or physics shape. /// @@ -217,18 +218,24 @@ private LDtkArtifactAssetsTileset MakeAndCacheArtifacts(TextureGenerationOutput LDtkArtifactAssetsTileset artifacts = ScriptableObject.CreateInstance(); artifacts.name = $"_{_definition.Def.Identifier}_Artifacts"; - LDtkProfiler.BeginSample("InitArrays"); + LDtkProfiler.BeginSample("InitLists"); artifacts._sprites = new List(_sprites.Count); artifacts._tiles = new List(_sprites.Count); artifacts._additionalSprites = new List(_additionalTiles.Count); LDtkProfiler.EndSample(); + LDtkProfiler.BeginSample("CustomDataToDictionary"); var customData = _definition.Def.CustomDataToDictionary(); + LDtkProfiler.EndSample(); + + LDtkProfiler.BeginSample("EnumTagsToDictionary"); var enumTags = _definition.Def.EnumTagsToDictionary(); + LDtkProfiler.EndSample(); + LDtkProfiler.BeginSample("IterateAllSpriteOutput"); for (int i = 0; i < output.sprites.Length; i++) { - LDtkProfiler.BeginSample("AddTile"); + LDtkProfiler.BeginSample("AddSpriteToAsset"); Sprite spr = output.sprites[i]; spr.hideFlags = HideFlags.HideInHierarchy; ImportContext.AddObjectToAsset(spr.name, spr); @@ -264,12 +271,13 @@ private LDtkArtifactAssetsTileset MakeAndCacheArtifacts(TextureGenerationOutput } LDtkProfiler.EndSample(); - LDtkProfiler.BeginSample("AddTile"); + LDtkProfiler.BeginSample("AddTileToAsset"); ImportContext.AddObjectToAsset(newTilesetTile.name, newTilesetTile); artifacts._sprites.Add(spr); artifacts._tiles.Add(newTilesetTile); LDtkProfiler.EndSample(); } + LDtkProfiler.EndSample(); LDtkProfiler.BeginSample("TryParseCustomData"); //process these after all the tiles are created because we might reference other tiles for animation