Search Unity

Ability to load an addressable asset with multiple labels?

Discussion in 'Addressables' started by JoWi_Uniform, Nov 8, 2019.

  1. JoWi_Uniform

    JoWi_Uniform

    Joined:
    Jul 14, 2017
    Posts:
    15
    Is it possible to load an addressable asset by passing a list of AssetLabelReferences?

    This is the line i'm having issues with:
    Code (CSharp):
    1. AsyncOperationHandle<IList<GameObject>> LoadingHandler = Addressables.LoadAssetsAsync<GameObject>(Label, null);

    I've got addressables loading via one assetlabelreference perfectly for what I want.
    Now, however i'd like to extend the system to allow selection of objects that only have all the labels I'm searching for.

    Instead of just 1 label I'd like to provide a list, I was hoping that this would be a built in feature as I think you can provide a list of keys that can return a list of assets?

    Everything I've tried so far hasn't worked, I tried my own repeating addressable load, sorting through which assets matched which labels but it's very slow and not very efficient.

    Can anyone suggest any solutions here?


    Cheers, Joe
     
  2. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    763
    Hey @JoWi_Uniform,

    Unfortunately this isn't something currently supported. It has come up a few times though so it's definitely something I'm sure we'll get added in before too long. That said, I can't promise anything even resembling the idea of a release date for something like this.

    If anyone has implemented a solution I hope they'll post it here for you to use.