unity3d - Yield return in AssetBundle.CreateFromMemory -
as documentation says ienumerator
methods executed thread, i'm confused why
assetbundlecreaterequest assetbundlecreaterequest = assetbundle.createfrommemory(bytearray); yield return assetbundlecreaterequest;
freezes game 2 seconds. can explain?
well freezes 2 seconds because requesting yield return assetbundlecreaterequest
asynchronous operation coroutine.
you can yield until asynchronous operation continues, or manually check whether it's done (isdone) or progress (progress). asyncoperation
so right requesting coroutine wait till assetbundlecreaterequest done.
for manually checking wheter function done, without having freeze application using isdone or progress command instead
if need further clarification feel free comment.
edit
sample of using isdone
assetbundlecreaterequest acr = assetbundle.createfrommemory(decrypteddata); while (!acr.isdone) { yield; } assetbundle bundle = acr.assetbundle;
Comments
Post a Comment