AssetReference vs Key (label)

I know how to load assets using both of those methods but what are the benefits of each method?

When should you use keys and when should you use asset reference, pros and cons?

Cheers!

2 Likes

So, I have been digging around bit more and it seems you can only use Asset References for locally available content. If the location you are calling it from do not know about it (e.g. a remote catalog) you have to use the keys.

I don’t think one was necessarily entirely better than the other, I suppose it’s a matter of preference. However me personally, if I had to pick I’d say using AssetReference is better, that way you can change the name and such of the addressable and it won’t break the linkage. It’s generally what I prefer. Although if loading by a key better fits your scenario, there should be no problem with that either.

See here: https://discussions.unity.com/t/813409/4

Its been a few days since I asked this question and I have been digging around and testing a lot since. What I found is it works really well if they are in one (single) project but if your content is in separate project, you can’t use these to reference them as your main project has no clue where these are. Latter is my case, so I ended up using labels. I will probably use a ScriptableObject to store these keys in my main project. Sort of like my own version of AssetRefs.