Trying to build some Editor tools for my co-workers, necessitating grabbing of assetbundles from WWW reads.
In the following script (from an EditorWindow class) the Console shows a single debug message tagged A1, followed by a message per "frame (tagged A2) indicating the www.progress goes from 0 to 1 smoothly in a fraction of a second, but the A3 message is never produced.
Attempting to use www.progress instead of www.isdone gets solid errors when I try to use the asset, informing me that it is incomplete.
Coroutines are pretty much out of the question due to this being in Editor rather than runtime. I’ve gone through a few items both here and from the wiki, but always end up with progress stating it is complete, and isdone saying it isn’t.
I’ve been working with Coroutines and assetbundles in runtime on web and windows standalone compiles for months. The particular files being loaded here work fine in both. Plus I’ve checked the URL string and it downloads freely from the server through a browser, as well as loading correctly to built standalone and web build.
Anything obvious I’ve missed, or Arcane that I need to know?
Edited to Add:
It seems that the entire Editor Window is going to sleep unless I keep opening and closing other items in the project or hierarchy. As long as I keep clicking randomly around the editor UI the WWW request does eventually return true. Is there a way of making the editor not go to sleep under specified circumstances?
` public void Update() { if (start == true) { Debug.Log("A1"); run = true; start = false; request = new WWW(assetURL); } else if (run == true) { Debug.Log("A2 ["+request.progress*100+"%]"); if (request.isDone) { Debug.Log("A3"); run = false; finished = true; if (request.error != null) { Debug.LogError(request.error); } else { AssetLibrary.assetlibrary.LoadSet(request, assetURL); } } else { assetProgress = request.progress; } } } `
start, run and finished are static bools, assetURL is a static String and request is a static WWW.