I’m getting a weird unexpected hitch of about 1 sec whenever I run AssetBundle.LoadAsync with a “new” bundle, where Update is not called on any script in the scene during this period. After I run LoadAsync once, the call runs in the background as expected. It’s almost as if the first run is synchronous, followed by asynchronous further calls. I’m still looking for a possible cause within my code, but I thought I would check with the forums at this point to see if this is known behavior.
Thanks in advance for any experiences w/LoadAsync you can share!
Edit: this behavior is observed on an iPad development build and Unity Pro.
After doing a lot more digging, I found this: yield on WWW? or AssetBundleRequest? or both? - Questions & Answers - Unity Discussions
It seems like Lucas Meijer is saying that the first call to the WWW.assetBundle getter blocks on instantiation of the assetBundle? If so, is there a plan to make this asynchronous so that we can yield on it instead of blocking?
Bump for the Tuesday crowd…
If you use a dummy WWW request in a start function this should help with the delay on the first “real” call.
For example if you throw this into a start function possibly on the main camera:
WWW w = new WWW(“file:///”);
This has the WWW system primed and ready for action on the next call.
Thanks! I will go try that out.