- Home /
Asset Bundle decompression causes long stall
I am trying to load a local asset bundle on IOS. The code is pretty straightforward, and very similar to many examples out there:
using(WWW www = WWW.LoadFromCacheOrDownload("file://" + url, version))
{
Debug.Log(www.threadPriority);
www.threadPriority = ThreadPriority.BelowNormal;
while (!www.isDone)
{
Debug.Log(www.progress);
yield return null;
}
}
The first time I do this, it can can take a long to decompress the asset bundle and cache it, which in itself is not a problem
My first idea was to show a progress indicator, but the progress granularity was far too useless for that. It goes from 0 to 0.01876441 to 1 without anything in the middle.
My theory is that it is merely giving me progress on the actual download (which should be pretty quick as it's from the local filesystem) and does not include the decompression.
That's fine, no progress then, just a generic activity indicator will do the trick!
However, no matter what I try with thread priorities or anything else, when it comes to the decompression step it simply hangs the whole app! I'm not doing anything else intensive at the same time either.
I'm very confused, aren't asset bundles meant to be suitable to implement on demand streaming without hickups?
All subsequent times I load the asset bundle it's near instantaneous, which is great.
Has anybody figured out how to smoothly load an assetbundle in the background?
Thanks, Willem