Best way of loading from an addressable folder. Labels? Same Addresses? Serializing?

Ok, so I’m not sure on how I should do this:
I have a project with a custom 2D animator system and I need to load the sprites, they are currently neatly organized each animation in a folder for each character, example:
Resources/Paladin/Attack
Resources/Paladin/Idle
Resources/Paladin/Walk
Resources/Mage/Attack
Resources/Mage/Idle
Resources/Mage/Walk

Using the Resources.Load system I can just load Paladin/Attack and get all it’s sprites, I can change the sprites freely and without any need of updating anything in the project or code. But doing the same with Adressable Assets is not being that easy, I found 3 possible solutions.

  1. Serialize the sprites into a .prefab and use the addressable system to load the prefab instead of the sprites. Though this doesn’t allow me to change sprites freely without hassle.

  2. Renaming the addresses. As stated by one of the devs, the addresses do not need to be unique, if more than one have the same name, I can load them all with only that one address. The problem is, I cannot find a way to rename multiple addresses quickly, I can only go one by one and "ctrl+v"ing that address. This really sounded like the proper solution, but ends up being a bigger hassle and even harder to update, unless there is some other way of doing this that I’m unaware of(please teach me if there is).

  3. Labels, with this I can accomplish what I tried to do in 2), though the way the UI looks, it’s almost screaming that I’m using this wrong. Since I’ll have many units and animations I’ll end up with a ton of labels, not sure if there is a limit or if it should be even used for this. With them I can just mark a Folder with that label and load it hassle free, using it as an “open assetBundle”.

So…am I using labels wrong? Is there a way to quickly change all addresses in a directory? Would it be possible to have a way to load all sprites in a specific addressable folder? Maybe something else entirely that I missed?

You are not using labels wrong, and unfortunately we don’t have a great solution for this workflow just yet. One of the things we’re considering is providing the option to “auto label” things based on the folder they are in, if you mark a folder as addressable. This would give you what you need, but with some overhead.

So I don’t really have good news, but I will say this use case helps point us towards some sort of auto-label system to solve it.

-Bill

1 Like