Skip to content

Commit e7f7f48

Browse files
committed
patch incorrect directory asset loading
1 parent 925ff3e commit e7f7f48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/AssetsHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public static Dictionary<string, byte[]> LoadDirectory(string directoryPath)
2424
foreach (var path in Directory.EnumerateFiles(directoryPath, "*", SearchOption.AllDirectories))
2525
{
2626
var extension = Path.GetExtension(path).ToLower();
27-
var relativePath = new Uri(directoryPath).MakeRelativeUri(new Uri(path)).OriginalString
28-
.Replace("/", "\\").ToLower();
27+
// might yield incorrect result if path doesn't start with directory path!!
28+
var relativePath = path.Substring(directoryPath.Length+1).Replace("/", "\\").ToLower();
2929
relativePath = relativePath.Substring(0, relativePath.Length - extension.Length);
3030

3131
if (extension.Length > 0)

0 commit comments

Comments
 (0)