Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Possible to load using partial address?

Discussion in 'Addressables' started by sunfl0wr, Nov 9, 2019.

  1. sunfl0wr

    sunfl0wr

    Joined:
    Mar 11, 2015
    Posts:
    13
    Is it possible to somehow search for assets using a partial address / wildcards?

    E.g. Lets say I have a group with a bunch of addressable names:
    Characters/Hero/Clothes/YellowPants
    Characters/Hero/Clothes/YellowShirt
    Characters/Hero/Clothes/GreenPants
    Characters/Hero/Clothes/GreenShirt
    Characters/Hero/Clothes/GreenHat

    Now I want to LoadAssetAsync all assets beginning with the address "Characters/Hero/Clothes/Green"

    Expected assets loaded would be:
    Characters/Hero/Clothes/GreenPants
    Characters/Hero/Clothes/GreenShirt
    Characters/Hero/Clothes/GreenHat

    Is something like this possible?
    It would be even better if you could use wildcards to make more advanced search queries.

    While at it, is there any way of making the address case-insensitive?
     
  2. senfield

    senfield

    Joined:
    Apr 1, 2019
    Posts:
    24
    Labels are supposed to cover this kind of functionality. You would make a green label and load that.
    One approach would be to setup an asset post processor script to automatically address and label the things you are interested in based on their path.
     
    sunfl0wr likes this.
  3. sunfl0wr

    sunfl0wr

    Joined:
    Mar 11, 2015
    Posts:
    13
    Post processing scripts sounds interesting, might look in to that, thanks :)