Search Unity

How can I modify addressables to show assets per specific folder?

Discussion in 'Addressables' started by VaygrEmpire, Jan 21, 2020.

  1. VaygrEmpire

    VaygrEmpire

    Joined:
    Sep 30, 2016
    Posts:
    40
    Currently when you make all sorts of assets into addressables, if you have something like
    Code (CSharp):
    1. AssetReference[] assetReferenceArray
    it would show ALL assets marked as addressables regardless of which type or which folder they are located in.

    If possible, I'd like to modify this to show certain type of addressable assets and per location of folder.

    Is there API for this? Or is this possible? If so, which script should I look into?
     
  2. ProtoTerminator

    ProtoTerminator

    Joined:
    Nov 19, 2013
    Posts:
    586
    I'm not sure about locations, but you can constrain the type. There are built-in types such as AssetReferenceGameObject that will constrain the type for you. They also provided AssetReferenceT<T> which you can define your own class to inherit from that to constrain to other types that they don't have built-ins for, such as Sprite.
    public class AssetReferenceSprite : AssetReferenceT<Sprite> { }