Skip to content

Commit 80aa132

Browse files
jaguireIrishBruse
authored andcommitted
fix assetName used for referenced textures when the parent ldtk is in a nested folder.
1 parent 03054da commit 80aa132

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

LDtk/Renderer/LDtkRenderer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ private Texture2D GetTexture(LDtkLevel level, string path)
170170
else
171171
{
172172
string file = Path.ChangeExtension(path, null);
173-
return content.Load<Texture2D>(file);
173+
string directory = Path.GetDirectoryName(level.WorldFilePath);
174+
string assetName = string.IsNullOrEmpty(directory) ? file : $"{directory}/{file}";
175+
return content.Load<Texture2D>(assetName);
174176
}
175177
}
176178

0 commit comments

Comments
 (0)