- Home /
Question by
vikingfabian-com · Jan 21, 2016 at 09:49 AM ·
webplayerassetbundlewwwweb
Web build: WWW downloads correctly, but www.assetBundle is Null
I have a bundle of about 10 .bytes files.
I follow the Unity WWW example.
I get www.isDone=true, and www.bytesDownloaded is the correct size, so it downloads something.
www.assetBundle is always null.
I use Dropbox Public folder as Server.
I get no error messages.
void Start() { StartCoroutine(LoadBundle()); } IEnumerator LoadBundle() { string downloadPath = FilePath.Url() + FilePath.Dir + DataLib.AssetBundlesDir + FilePath.Dir + "mainbundle"; using (WWW www = new WWW(downloadPath)) { yield return www; if (www.error != null) throw new Exception("WWW download had an error:" + www.error); AssetBundle bundle = www.assetBundle; Debug.Log("wwwResult: is done: " + www.isDone.ToString() + ", progress: " + www.progress.ToString() + ", bytesDownloaded: " + www.bytesDownloaded.ToString()); // www.isDone is true //www.bytesDownloaded are correct //but www.assetBundle is Null } }
Comment
I seem to be having the same issue. Have you found a solution to this problem?
I did some more testing last night, and found that it looks like the WWW item stopped downloading the file before it finished. I don't know why, but the WWW object kept insisting that it finished download the file despite the number of bytes downloaded being less than a tenth of the size of the file.