how to download Asset Bundles from website to Application.dataPath across platforms ?

I’m putting an exported bundle online , it can be download but I only know how windows functions , i know nothing of Linux nor Mac.

I would have to redirect the download path to the folder hosting the executable game file bit i do not know how to accomplish that .

how can i get this done ?

when i have the bundle in the file location i then set the path for which the bundle is fetched using

Application.dataPath

then after writing the appropriate code , the bundles should be instantiated in my game on play.

1 Answer

1

The AssetBundle itself is just the assets loaded into memory, it cannot be saved to the disk.
On the other hand, the WWW object, downloads the file itself, so before converting the WWW result into an AssetBundle, you can save it to the disk, using WWW.bytes to get the bytes, and File.WriteAllBytes() to save to disk.

See complete answer here:

In your case, you’ll want:

File.WriteAllBytes(Application.dataPath + "/" + filename, bytes);

by any change , would you know how to implement the [file browse dialogue code][1] I have never come across a code structure like this. [1]: http://wiki.unity3d.com/index.php/ImprovedFileBrowser

thanks for the help . I see how its done now .