docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MetadataSearchFilter

    A filter for selecting assets to import based on custom metadata.

    Inheritance
    object
    MetadataSearchFilter
    Implements
    IDictionary<string, Metadata>
    ICollection<KeyValuePair<string, Metadata>>
    IEnumerable<KeyValuePair<string, Metadata>>
    IEnumerable
    ISerializationCallbackReceiver
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.AssetManager.Editor
    Assembly: Unity.AssetManager.Core.Editor.dll
    Syntax
    [Serializable]
    public class MetadataSearchFilter : IDictionary<string, Metadata>, ICollection<KeyValuePair<string, Metadata>>, IEnumerable<KeyValuePair<string, Metadata>>, IEnumerable, ISerializationCallbackReceiver
    Remarks

    All metadata fields are combined with "AND" logic, meaning that an asset must match all metadata fields to be included in the search results.

    Properties

    Count

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int

    this[string]

    Declaration
    public Metadata this[string key] { get; set; }
    Parameters
    Type Name Description
    string key
    Property Value
    Type Description
    Metadata

    Keys

    Declaration
    public ICollection<string> Keys { get; }
    Property Value
    Type Description
    ICollection<string>

    Values

    Declaration
    public ICollection<Metadata> Values { get; }
    Property Value
    Type Description
    ICollection<Metadata>

    Methods

    Add(string, Metadata)

    Adds a search term to the metadata filter.

    Declaration
    public void Add(string key, Metadata value)
    Parameters
    Type Name Description
    string key

    The key of the metdata field to add. This can be retrieved from the display name using the GetMetadataKeyFromDisplayNameAsync(string, CancellationToken) method.

    Metadata value

    The metadata value to search for.

    AddOrReplace(string, bool)

    Adds a boolean search term to the metadata filter.

    Declaration
    public void AddOrReplace(string key, bool value)
    Parameters
    Type Name Description
    string key

    The key of the metdata field to add. This can be retrieved from the display name using the GetMetadataKeyFromDisplayNameAsync(string, CancellationToken) method.

    bool value

    The boolean value to search for.

    AddOrReplace(string, IEnumerable<string>)

    Adds an array of string values to the metadata filter.

    Declaration
    public void AddOrReplace(string key, IEnumerable<string> values)
    Parameters
    Type Name Description
    string key

    The key of the metdata field to add. This can be retrieved from the display name using the GetMetadataKeyFromDisplayNameAsync(string, CancellationToken) method.

    IEnumerable<string> values

    The array of string values to search for.

    AddOrReplace(string, DateTime)

    Adds a time stamp search term to the metadata filter.

    Declaration
    public void AddOrReplace(string key, DateTime value)
    Parameters
    Type Name Description
    string key

    The key of the metdata field to add. This can be retrieved from the display name using the GetMetadataKeyFromDisplayNameAsync(string, CancellationToken) method.

    DateTime value

    The timestamp value to search for.

    AddOrReplace(string, double)

    Adds a number search term to the metadata filter.

    Declaration
    public void AddOrReplace(string key, double value)
    Parameters
    Type Name Description
    string key

    The key of the metdata field to add. This can be retrieved from the display name using the GetMetadataKeyFromDisplayNameAsync(string, CancellationToken) method.

    double value

    The number value to search for.

    AddOrReplace(string, string)

    Adds a string search term to the metadata filter.

    Declaration
    public void AddOrReplace(string key, string value)
    Parameters
    Type Name Description
    string key

    The key of the metdata field to add. This can be retrieved from the display name using the GetMetadataKeyFromDisplayNameAsync(string, CancellationToken) method.

    string value

    The string value to search for.

    Clear()

    Declaration
    public void Clear()

    ContainsKey(string)

    Declaration
    public bool ContainsKey(string key)
    Parameters
    Type Name Description
    string key
    Returns
    Type Description
    bool

    GetEnumerator()

    Declaration
    public IEnumerator<KeyValuePair<string, Metadata>> GetEnumerator()
    Returns
    Type Description
    IEnumerator<KeyValuePair<string, Metadata>>

    OnAfterDeserialize()

    Implement this method to receive a callback after Unity deserializes your object.

    Declaration
    public void OnAfterDeserialize()

    OnBeforeSerialize()

    Implement this method to receive a callback before Unity serializes your object.

    Declaration
    public void OnBeforeSerialize()

    Remove(string)

    Declaration
    public bool Remove(string key)
    Parameters
    Type Name Description
    string key
    Returns
    Type Description
    bool

    TryGetValue(string, out Metadata)

    Declaration
    public bool TryGetValue(string key, out Metadata value)
    Parameters
    Type Name Description
    string key
    Metadata value
    Returns
    Type Description
    bool

    Implements

    IDictionary<TKey, TValue>
    ICollection<T>
    IEnumerable<T>
    IEnumerable
    ISerializationCallbackReceiver
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)