LoadAssetsAsync using Asset Locations

I am trying to load a level and all the characters and attacks etc. I want to show the user a loading screen with a progress bar that reflects the percentage downloaded.

I want to load prefabs using their asset locations. I only want to use labels for “hd”, “sd”.

How do I do that? I can’t find an example in Addressables-Sample that loads multiple prefabs in one call. I can only load single assets, like so:

Addressables.LoadAssetAsync<GameObject>("Assets/Campaigns/Nottingham/Nottingham.prefab");
Addressables.LoadAssetAsync<GameObject>("Assets/Campaigns/Nottingham/Enemy.prefab");

I actually can’t get any list-based calls to work. DownloadDependenciesAsync, LoadResourceLocationsAsync, LoadAssetsAsync, all generate invalid key exceptions no matter what I try.

Asked another way …

On this page Operations | Addressables | 1.19.19
It says
“If the operations all load assets, you can combine them with a single call to the Addressables.LoadAssetsAsync function”

The only Addressables.LoadAssetsAsync examples I have found are in Addressables-Sample, but they both seem to use a list to load a single prefab.

Which Addressables.LoadAssetsAsync call can I use to load multiple prefabs without using labels?

If the answer involves a list of IResourceLocation then how do I create that? LoadResourceLocations has the same issue where I can’t get that to work with a list of keys either. And again the examples either load a single asset or use labels.

1 Like