docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method GetFieldsWithAttribute

    GetFieldsWithAttribute(Type, Type, List<FieldInfo>, BindingFlags)

    Get the fields with attribute of attributeType in type.

    Declaration
    public static void GetFieldsWithAttribute(this Type type, Type attributeType, List<FieldInfo> fields, BindingFlags bindingAttr = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
    Parameters
    Type Name Description
    Type type

    The type in which to search for the attribute.

    Type attributeType

    The attribute type for which to search.

    List<FieldInfo> fields

    A list containing the FieldInfo of the fields with the attribute specified by attributeType.

    BindingFlags bindingAttr

    Binding flags of the attribute.

    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)