How can I download an asset bundle (in a standalone app, not web player) and save it to a folder on the local hard drive?
I know how to download one and then instantiate it, but I'm not clear on the saving to hard drive part.
How can I download an asset bundle (in a standalone app, not web player) and save it to a folder on the local hard drive?
I know how to download one and then instantiate it, but I'm not clear on the saving to hard drive part.
Ok I got it figured out so I'll put it here for anyone else looking. If anyone has a better way to do it please post here:
import System.IO;
var path = "local path on hard drive to write to";
function SaveDownloaded(filename)
{
Debug.Log("Attempting to download this file: "+filename);
var fileURL = "www.yourdomain.com/assets/"+filename;
var www : WWW = new WWW (fileURL);
yield www;
var bytes = www.bytes;
File.WriteAllBytes(path+"/" + filename, bytes);
}