Home > other >  WWW Android path problem loading external resources
WWW Android path problem loading external resources

Time:09-24

I want to use the WWW load external resources,
Path on the computer as PathURL="file:///D:/prefab1.assetbundle"; Can successfully loaded (prefab1 assetbundle) under the path;
Written the path on Android PathURL=PathURL=Application. StreamingAssetsPath + "/prefab1. Assetbundle";; . Then put prefab1 assetbundle under the project Assets folder can also load;
Now, I put the prefab1 assetbundle on "mobile phone/Android root directory" folder, the path how to write? Tried a lot he couldn't do it,,,

Read the resource code:
WWW bundle=new WWW (PathURL);
Yield return bundle;
//loaded into the game
Yield return Instantiate (bundle. AssetBundle. MainAsset);
Bundle. AssetBundle. Unload (false);

CodePudding user response:

I guess this is because, through unity can operate directory on different platform has different limit, is not you can write to the directory,
Seems to be under the android, the operating scope of SD card as a memory than operation range,
Above is my guess, unconfirmed,
  • Related