Hello !
I am trying this for a week, and still can’t succeed :
I have my assetbundle stored in my server, I want to download it and store it to local disk to reuse it from the disk and don’t download this assetbundle everytime my app run (android for the moment). So I’ve made this script :
public class LoadAsset : MonoBehaviour { //IEnumerator allows yield so the information is not accessed //before it finished downloading IEnumerator Start () { string objURL = "myurl"; //location of the file // Download the asset bundle WWW objWWW = new WWW(objURL); yield return objWWW; // wait for download to finish // Instantiate the asset bundle Instantiate(objWWW.assetBundle.mainAsset); SaveDownloadedAsset(objWWW); // and save it to disk } public void SaveDownloadedAsset(WWW obj) { try { // write out the file string filePath = "F:" + "/" + "moimee" + ".unity3d"; var bytes = obj.bytes; // initialize the byte string File.WriteAllBytes(filePath, bytes); // write the object out to disk } catch(Exception e) { Debug.Log("Couldn't save file: " + System.Environment.NewLine + e); } } } ` It writes the correct downloaded assetbundle (verifying with sublime text) in the good location. It's a unity3d package but when I try to import it, Unity says : Error while importing package: Couldn't decompress package I've been trying with uncompressed and compressed assetbundle and with the good platform target (android). I test it on my Unity_4.6.5f1 on a Windows PC on Android platform. What's wrong ? I've been looking for many threads (it's not a problem of non english character in my path) but can't figure out where the problem can be. Thank you in advance ! `