I’m trying to download asset bundles inside the editor. Yield does not work inside the editor so I need to use an update loop and the www.isDone method to track when the download is finished. For more info see previous post.
So, I’ve been doing some tests with asset bundles using the isDone function rather than yield and it seems that the isDone function never actually gets run. Here’s the function I’m testing which runs every frame:
static var download : WWW;
function EditorUpdate () {
print("editor update running. download="+download);//this prints every frame yey!!
if(assetRequested==false)//I just do this so the request only gets made once
{
assetRequested=true;
LoadAssetBundle("someBundle.unity3d");
}
if (download.error != null) //no errors get reported..
{
Debug.LogError(download.error);
DebugConsole.Log(download.error);
}
if (download.isDone)
{
//NEVER GETS HERE :(
print("download done inside editor");
assetRequested=false;
}
//A test
print("progress="+download.progress);//this prints 0 and then 1 after a few seconds
}
As I noticed that the download.progress was actually reaching 1, I tried swapping it for the isDone event, however this just then returns an error if I then try to instantiate the asset bundle saying that the bundle hasn’t finished downloading.
Does anyone know if isDone actually works for asset bundles? I read on another post that it had ‘a bug’ but there was no more info.
Can anyone help me with this issue? WHat other way can I detect if an assetbundle has downloaded without using Yield?
P.S. I have a pro licence, the download url is correct, a crossdomain policy file and build settings are set to webplayer.- ie This download works fine using a yield function.
Cheers!