Skip to content

Commit 60eef08

Browse files
committed
removed file:// from webrequ. loader path > URI class will add this
also fixes not found error when a space and plus is name
1 parent 80e4d07 commit 60eef08

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Runtime/Scripts/Loader/UnityWebRequestLoader.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ public async Task<Stream> LoadStreamAsync(string relativeFilePath)
1919
{
2020
var path = Path.Combine(dir, relativeFilePath).Replace("\\","/");
2121

22-
if (File.Exists(Path.GetFullPath(path)))
23-
path = "file://" + Path.GetFullPath(path);
22+
var fullPath = Path.GetFullPath(path);
23+
if (File.Exists(fullPath))
24+
path = fullPath;
2425
var request = UnityWebRequest.Get(new Uri(path));
2526
// request.downloadHandler = new DownloadStreamHandler(new byte[1024 * 1024]);
2627
var asyncOperation = request.SendWebRequest();

0 commit comments

Comments
 (0)