Search Unity

Feedback My personal feedback about Addressables

Discussion in 'Addressables' started by Remer, Apr 8, 2020.

  1. Remer

    Remer

    Joined:
    Mar 24, 2013
    Posts:
    79
    Hello,
    I'm using addressables since a week and I think they are a great tool, however i have some feedback to share with you.

    I'm working on a trading card game, and i'm using Addressables for artworks. Actually i have a small number of sprites and when i try to assign an artwork to a card (a scriptable object) I have this situation:
    addressable.png
    Some of this are artworks of course, but some aren't. When I will have a large amount of sprites it will become impossible to select the right asset.
    So I think every element should be associated with its package, like the localization tool does:
    addressable 2.png
    Also I think it would be great to be able to specify a specific package / tag via script, for istance:
    Code (CSharp):
    1. [UseAddressablePackage("name"), SerializeField] private AssetReferenceT<Sprite> m_Artwork;
    And then the UI will show ONLY sprites inside package (or tag) "name" (using UseAddressablePackage or maybe UseAddressableTag("tag")).

    Also, I can't assign an addressable to multiple scriptable objects, I don't know if it's a bug or a "feature".
    If I select multiple scriptable objects and then a sprite from the list, it simply does nothing.
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,820
    Thank you for the feedback. I'll forward this over to the team for them to review! Which version of Addressables and the editor are you using?
     
  3. Remer

    Remer

    Joined:
    Mar 24, 2013
    Posts:
    79
    Unity 2019.3.9 and Addressables 1.7.5
     
  4. davidrochin

    davidrochin

    Joined:
    Dec 17, 2015
    Posts:
    72
    +1 for this
     
  5. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,820
    The team are creating a ticket to look into this further. I wanted to thank you again for the feedback, and to encourage you to keep it up! Help us be better. :)
     
  6. Remer

    Remer

    Joined:
    Mar 24, 2013
    Posts:
    79
    Hello, i have another 2 feedbacks to share.
    First, what do you think of the possibility of being able to setup package and tag directly into the asset inspector? (see mockup)

    Also, it would be very useful to have an api for chain operations. I have a scriptable object (a card) that contains a lot of addressables (sprites, materials etc.). So, i need to call a script AFTER all assets are loaded (and i dont want to use an await, i prefer to launch all LoadAssetAsync concurrently)
     

    Attached Files:

  7. ProtoTerminator

    ProtoTerminator

    Joined:
    Nov 19, 2013
    Posts:
    586
    I just want to say that chaining operations is beyond the scope of Addressables, imo. Using await to chain async operations is the proper way to do it (and is why they added the
    .Task
    property). You can launch and await multiple async operations concurrently using
    Task.WhenAll
    .

    If you prefer the Promise way of chaining async operations (
    promise.Then(() => {})
    instead of
    await task
    ), check out my Promise library: https://forum.unity.com/threads/proto-promise-library.790508/. I personally use this in my project with great success. Because it was beyond the scope of that library, you will need to write an extension to convert an AsyncOperationHandle to a Promise, which I can give you if you're interested.
     
  8. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    One alternative way of doing this is to actually use direct asset references to those assets. Addressables will automatically load the dependencies for an asset, so the bundles they are on will be loaded for you. It sounds like you already have those assets addressable anyway, so that's the potential for asset duplication fixed anyway. If you hadn't you can extract duplicate dependencies using one of the analysis rules, but then you get less control over the bundling, unless you modify addressables (which is what we've done, adding an extra packing mode).

    If you have extreme numbers of assets and dependencies, you can potentially run into editor/build time performance issues when having direct asset dependencies to assets, large textures in particular. That can be solved with LazyLoadReference<T>.
     
    Last edited: Jun 29, 2020
  9. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Just jumping in here to give a quick comment on the original question. I'm not exactly sure what you mean by "tag" and "package", but we have an infrastructure for you to do that, and one example in the addressables package. Take a look at
    AssetReferenceUILabelRestriction 
    and
    AssetReferenceUILabelRestrictionSurrogate
    . These provide restrictions on what's in an asset reference dropdown based on the addressables label (our form of tags). So if that "tagging" works, you're done. Otherwise you could take a look at those classes, create your own that inherit from the appropriate classes, and instead filter by whatever you'd like.

    Hope this helps.
     
    glitchers likes this.