docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method HasAttribute

    HasAttribute<T>(Type)

    Determine if the type has an attribute.

    Declaration
    public static bool HasAttribute<T>(this Type type) where T : Attribute
    Parameters
    Type Name Description
    Type type

    The type.

    Returns
    Type Description
    bool

    true if type has attribute, false otherwise.

    Type Parameters
    Name Description
    T

    The attribute type.

    HasAttribute<T>(Enum)

    Determine if the enum value has an attribute.

    Declaration
    public static bool HasAttribute<T>(this Enum enumValue) where T : Attribute
    Parameters
    Type Name Description
    Enum enumValue

    The enum value.

    Returns
    Type Description
    bool
    Type Parameters
    Name Description
    T

    The attribute type.

    In This Article
    Back to top
    Copyright © 2024 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)