docs.unity.cn
    Show / Hide Table of Contents

    Class TagCatalog

    The catalog storing tags.

    Inheritance
    Object
    TagCatalog
    Namespace: UnityEngine.GameFoundation
    Syntax
    public class TagCatalog

    Methods

    Contains(Tag)

    Tells whether or not this catalog contains the specified Tag.

    Declaration
    public bool Contains(Tag tag)
    Parameters
    Type Name Description
    Tag tag

    The Tag to find.

    Returns
    Type Description
    Boolean

    true if a Tag instance exists in this catalog with the specified tag, false otherwise.

    Exceptions
    Type Condition
    ArgumentNullException

    If the tag parameter is null.

    Find(String)

    Looks for a Tag by its key.

    Declaration
    public Tag Find(string key)
    Parameters
    Type Name Description
    String key

    The key of the Tag to find.

    Returns
    Type Description
    Tag

    The requested Tag instance, or

    null
    if not found.

    Exceptions
    Type Condition
    ArgumentNullException

    If the key parameter is null.

    GetTags(ICollection<Tag>, Boolean)

    Fills in the given target collection with all the Tag instances of this catalog, and returns their count. The target collection is cleared before being populated.

    Declaration
    public int GetTags(ICollection<Tag> target = null, bool clearTarget = true)
    Parameters
    Type Name Description
    ICollection<Tag> target

    The target container of all the Tag instances.

    Boolean clearTarget

    If true, it clears the target collection before populating.

    Returns
    Type Description
    Int32

    The number of Tag instances found.

    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on 16 June 2021