Skip to content

Commit

Permalink
style: profiler calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Cammin committed May 13, 2024
1 parent 5eba15e commit 7b73865
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 1 addition & 5 deletions Assets/LDtkUnity/Editor/ScriptedImporter/LDtkJsonImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,6 @@ public Sprite GetAdditionalSprite(LDtkProjectImporter project, TilesetDefinition

protected Dictionary<int, LDtkArtifactAssetsTileset> MakeTilesetDict(LDtkProjectImporter project, LdtkJson json)
{
Profiler.BeginSample("MakeTilesetDict");

//construct a dictionary to get artifacts by tileset uid
Dictionary<int, LDtkArtifactAssetsTileset> artifacts = new Dictionary<int, LDtkArtifactAssetsTileset>();
foreach (TilesetDefinition def in json.Defs.Tilesets)
Expand All @@ -234,8 +232,6 @@ protected Dictionary<int, LDtkArtifactAssetsTileset> MakeTilesetDict(LDtkProject

artifacts.Add(def.Uid, artifactTileset);
}

Profiler.EndSample();
return artifacts;
}

Expand All @@ -261,7 +257,7 @@ internal LDtkArtifactAssetsTileset LoadTilesetArtifacts(LDtkProjectImporter proj
Logger.LogWarning($"The tileset file \"{tilesetImporter.AssetName}\" ({tilesetImporter._pixelsPerUnit}) doesn't have the same pixels per unit as it's project \"{AssetName}\" ({project.PixelsPerUnit}). Ensure they match.");
}

Profiler.BeginSample("LoadArtifacts");
Profiler.BeginSample("TilesetImporter.LoadArtifacts");
LDtkArtifactAssetsTileset artifacts = tilesetImporter.LoadArtifacts(Logger);
Profiler.EndSample();

Expand Down
2 changes: 2 additions & 0 deletions Assets/LDtkUnity/Editor/ScriptedImporter/LDtkLevelImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ private bool InitializeDefinitionObjects()
return false;
}

Profiler.BeginSample("MakeTilesetDict");
var tilesets = MakeTilesetDict(_projectImporter, _projectJson);
Profiler.EndSample();

Profiler.BeginSample("InitializeFromLevel");
DefinitionObjects.InitializeFromLevel(artifacts._definitions, tilesets);
Expand Down

0 comments on commit 7b73865

Please sign in to comment.