Hello,
I am having a little issue with loading an asset bundle from the sdcard of an android device. What I hope to accomplish is to download an asset bundle, save it on the SDcard on an android device, then load it from the SDcard. I can save the .unty3d file to the sdcard with no issues, but the issue is loading it in to the game. Seeing as there is no way to load an asset bundle without the www class, I use the www class with the file:// protocol like so:
WWW www = new WWW (@"file:///sdcard/items/shirt.unity3d");
I also tried using this
WWW www = WWW.LoadFromCacheOrDownload (@"file:///sdcard/items/shirt.unity3d",1);
but I get the same results.
what happens is that www.error is null (so, no errors), but, so is www.assetBundle! (this should not be null). So naturally, the following line does not work:
GameObject go = (GameObject)Instantiate(www.assetBundle.mainAsset);
The tricky part is that the exact same code works well while using/testing it in the editor. The only difference is that I change the file path to some remote dir on my computer. Also, while on the phone, I can read the unity3d file I want with a BinaryReader. I have some test code in the same co-routine to verify that the file exist, and can be read from.
any ideas on what is going on?
thanks,