docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Class TypeExtensions

    Extension methods for Type objects.

    Inheritance
    object
    TypeExtensions
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.XR.CoreUtils
    Assembly: solution.dll
    Syntax
    public static class TypeExtensions

    Methods

    Name Description
    GetAssignableTypes(Type, List<Type>, Func<Type, bool>)

    Adds all types assignable to this one to a list, using an optional predicate test.

    GetAttribute<TAttribute>(Type, bool)

    Gets the first attribute of a given type.

    GetExtensionsOfClass(Type, List<Type>)

    Finds all types that extend the given class type and appends them to a list If the input type is not an class type, no action is taken.

    GetFieldInTypeOrBaseType(Type, string)

    Search by name through a fields of a type and its base types and return the field if one is found.

    GetFieldRecursively(Type, string, BindingFlags)

    Gets a specific field of the Type or any of its base Types.

    GetFieldsRecursively(Type, List<FieldInfo>, BindingFlags)

    Gets all fields of the Type or any of its base Types.

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

    Get the fields with attribute of attributeType in type.

    GetFullNameWithGenericArguments(Type)

    Returns a human-readable, assembly qualified name for a class with its assembly qualified generic arguments filled in.

    GetGenericInterfaces(Type, Type, List<Type>)

    Searches through all interfaces implemented by this type and, if any of them match the given generic interface, appends them to a list.

    GetImplementationsOfInterface(Type, List<Type>)

    Finds all types that implement the given interface type and appends them to a list. If the input type is not an interface type, no action is taken.

    GetInterfaceFieldsFromClasses(IEnumerable<Type>, List<FieldInfo>, List<Type>, BindingFlags)

    Gets the field info on a collection of classes that are from a collection of interfaces.

    GetMethodRecursively(Type, string, BindingFlags)

    Searches this type and all base types for a method by name.

    GetNameWithFullGenericArguments(Type)

    Returns a human-readable name for a class with its assembly qualified generic arguments filled in.

    GetNameWithGenericArguments(Type)

    Returns a human-readable name for a class with its generic arguments filled in.

    GetPropertiesRecursively(Type, List<PropertyInfo>, BindingFlags)

    Gets all properties of the Type or any of its base Types.

    GetPropertyRecursively(Type, string, BindingFlags)

    Gets a specific property of the Type or any of its base Types.

    IsAssignableFromOrSubclassOf(Type, Type)

    Tests if class type IsAssignableFrom or IsSubclassOf another type.

    IsDefinedGetInheritedTypes<TAttribute>(Type, List<Type>)

    Returns an array of types from the current type back to the declaring type that includes an inherited 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)