Hi, I’m having issue with API Addressables.LoadAssetsAsync. It seem to be blocking other LoadAssetAsync or InstantiateAsync operation until the LoadAssetsAsync finish.
I’m using this API:
var op = Addressables.LoadAssetsAsync<UnityEngine.Object>(Keys, result =>{...}, Addressables.MergeMode.Union, true);
Any idea how to resolve this?
I’m using addressable 1.18.15 with Unity 2020.3.11f1
Hey, just wanted to chime in. I think what you’re running into is an engine side limitation. Typically we see this behavior with scenes since they require integration on the main thread (you can read a little about it here: Unity - Scripting API: AsyncOperation.allowSceneActivation). I imagine something that you’re trying to load requires main thread integration, which would also block the async operation queue.
Unfortunately, that means I don’t really have a good solution for how to resolve this. The thing I might recommend is to try and combine more of your keys into one load call, and as the assets are loaded you can cache references to them in a map. Then use that map to request assets after their initial load. I can’t guarantee that’ll work for you, since I don’t know more about your project. It’s kind of a shot in the dark. But, it might be something to consider and test out.
Sorry I wasn’t more helpful, but I hope that gives some clarification on what you’re seeing at least
Thanks, It’s really helpful to know what might cause the limitation. There’re some assets I need from addressable that are load with Awake callback (So as soon as the scene is loaded). I was able to reduce the blocking time significantly by combining multiple key into 1 load call like you suggest, the blocking still there but it tolerable.