I create AssetBundle from memory:
void enter()
{
createRequest = AssetBundle.CreateFromMemory(bundleBytes); //createRequest is field inside a class
}
Then I poll for result in separate method:
void update()
{
if (createRequest != null && createRequest.isDone)
{
//do the job
}
}
But when I profile in Unity editor I see that this method takes too long (the game actually pauses, seems like synchronous behavior). I compared AssetBundle.CreateFromMemory() to AssetBundle.CreateFromMemoryImmediate() and found that in my case it takes the same time (~1s).
What's wrong?
↧