Odin has a dedicated attribute overview with examples

AssetListAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.Delegate | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter | AttributeTargets.All, AllowMultiple = false, Inherited = true)]
public sealed class AssetListAttribute : Attribute, _Attribute

AssetLists is used on lists and arrays and single elements of unity types, and replaces the default list drawer with a list of all possible assets with the specified filter.

Use this to both filter and include or exclude assets from a list or an array, without navigating the project window.

  • System.Object
  • System.Attribute
  • AssetListAttribute

Asset lists works on all asset types such as materials, scriptable objects, prefabs, custom components, audio, textures etc, and does also show inherited types.


The following example will display an asset list of all prefabs located in the project window.

public class AssetListExamples : MonoBehaviour
    [InfoBox("The AssetList attribute work on both lists of UnityEngine.Object types and UnityEngine.Object types, but have different behaviour.")]
    public GameObject Prefab;

    public List<PlaceableObject> PlaceableObjects;

    [AssetList(Path = "Plugins/Sirenix/")]
    public UnityEngine.Object Object;

    [AssetList(AutoPopulate = true)]
    public List<PlaceableObject> PlaceableObjectsAutoPopulated;

    [AssetList(LayerNames = "MyLayerName")]
    public GameObject[] AllPrefabsWithLayerName;

    [AssetList(AssetNamePrefix = "Rock")]
    public List<GameObject> PrefabsStartingWithRock;

    [AssetList(Path = "/Plugins/Sirenix/")]
    public List<GameObject> AllPrefabsLocatedInFolder;

    [AssetList(Tags = "MyTagA, MyTabB", Path = "/Plugins/Sirenix/")]
    public List<GameObject> GameObjectsWithTag;

    [AssetList(Path = "/Plugins/Sirenix/")]
    public List<Material> AllMaterialsInSirenix;

    [AssetList(Path = "/Plugins/Sirenix/")]
    public List<ScriptableObject> AllScriptableObjects;

    [InfoBox("Use a method as a custom filter for the asset list.")]
    [AssetList(CustomFilterMethod = "HasRigidbodyComponent")]
    public List<GameObject> MyRigidbodyPrefabs;

    private bool HasRigidbodyComponent(GameObject obj)
        return obj.GetComponent<Rigidbody>() != null;



Initializes a new instance of the AssetListAttribute class.

public AssetListAttribute()



Filter the asset list to only include assets which name begins with.

public string AssetNamePrefix

If true, all assets found and displayed by the asset list, will automatically be added to the list when inspected.

public bool AutoPopulate

Filter the asset list to only include assets for which the given filter method returns true.

public string CustomFilterMethod

Filter the asset list to only include assets with a specified layer.

public string LayerNames

Filter the asset list to only include assets which is located at the specified path.

public string Path

Comma separated list of tags to filter the asset list.

public string Tags