www class download local file (Windows Universal Platform - Hololens)
Hi,
I'm following this tutorial:
https://unity3d.com/learn/tutorials/topics/scripting/assetbundles-and-assetbundle-manager
I'm trying to have a set of scenes as AssetBundles, saved somewhere on my local drive and the Hololens Unity app that will import this scenes at a runtime.
I tested it in the Unity Editor and it worked as designed. Then I tried to build it and send it to Hololens Emulator. It worked when I used asset url as http:// but it didn't when I used local path file:///. Then I simplified the project and try to download a plain jpg file but it also failed:
Failed downloading bundle test.jpg from file:///C:/Users/bsuchorowski/Documents/test.jpg: Couldn't open file /C:/Users/bsuchorowski/Documents/test.jpg
I found out that:
When I type file:// (double slash) then the path in the error looks like that: "/Users/bsuchorowski/Documents/test.jpg"
When I type file:///(triple slash) then the path in the error looks like that: "/C:/Users/bsuchorowski/Documents/test.jpg"
I can't figure it out how to get rid off that extra slash before C:. Am I doing something wrong?
Unity 5.5.2f1
Answer by bsuchorowski · Apr 06, 2017 at 07:45 AM
I think I solved it. I made a mistake assuming that Emulator will be able to access local files.
Nevertheless, callstack is a bit confusing:
Couldn't open file /C:/Users/bsuchorowski/Documents/test.jpg
it may seem as badly formmated URL.
Your answer
Follow this Question
Related Questions
Not possible to cache assetbundles behind server authentication? 0 Answers
Using Asset Bundle on Web Server for image sequence animation 0 Answers
Loading scene from bundle in Unity5 appears empty 0 Answers
WWW class Windows Store 0 Answers
Video plays from Assetbundle in Cache Folder only on second play 0 Answers