docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class fsPortableReflection

    This wraps reflection types so that it is portable across different Unity runtimes.

    Inheritance
    object
    fsPortableReflection
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.VisualScripting.FullSerializer.Internal
    Assembly: Unity.VisualScripting.Core.dll
    Syntax
    public static class fsPortableReflection

    Fields

    EmptyTypes

    Declaration
    public static Type[] EmptyTypes
    Field Value
    Type Description
    Type[]

    Methods

    AsMemberInfo(Type)

    Declaration
    public static MemberInfo AsMemberInfo(Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    MemberInfo

    AsType(MemberInfo)

    Declaration
    public static Type AsType(MemberInfo member)
    Parameters
    Type Name Description
    MemberInfo member
    Returns
    Type Description
    Type

    GetAttribute(MemberInfo, Type, bool)

    Fetches the given attribute from the given MemberInfo. This method applies caching and is allocation free (after caching has been performed).

    Declaration
    public static Attribute GetAttribute(MemberInfo element, Type attributeType, bool shouldCache)
    Parameters
    Type Name Description
    MemberInfo element

    The MemberInfo the get the attribute from.

    Type attributeType

    The type of attribute to fetch.

    bool shouldCache
    Returns
    Type Description
    Attribute

    The attribute or null.

    GetAttribute<TAttribute>(MemberInfo)

    Declaration
    public static TAttribute GetAttribute<TAttribute>(MemberInfo element) where TAttribute : Attribute
    Parameters
    Type Name Description
    MemberInfo element
    Returns
    Type Description
    TAttribute
    Type Parameters
    Name Description
    TAttribute

    GetAttribute<TAttribute>(MemberInfo, bool)

    Fetches the given attribute from the given MemberInfo.

    Declaration
    public static TAttribute GetAttribute<TAttribute>(MemberInfo element, bool shouldCache) where TAttribute : Attribute
    Parameters
    Type Name Description
    MemberInfo element

    The MemberInfo to get the attribute from.

    bool shouldCache

    Should this computation be cached? If this is the only time it will ever be done, don't bother caching.

    Returns
    Type Description
    TAttribute

    The attribute or null.

    Type Parameters
    Name Description
    TAttribute

    The type of attribute to fetch.

    GetDeclaredConstructor(Type, Type[])

    Declaration
    public static ConstructorInfo GetDeclaredConstructor(this Type type, Type[] parameters)
    Parameters
    Type Name Description
    Type type
    Type[] parameters
    Returns
    Type Description
    ConstructorInfo

    GetDeclaredConstructors(Type)

    Declaration
    public static ConstructorInfo[] GetDeclaredConstructors(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    ConstructorInfo[]

    GetDeclaredFields(Type)

    Declaration
    public static FieldInfo[] GetDeclaredFields(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    FieldInfo[]

    GetDeclaredMember(Type, string)

    Declaration
    public static MemberInfo GetDeclaredMember(this Type type, string memberName)
    Parameters
    Type Name Description
    Type type
    string memberName
    Returns
    Type Description
    MemberInfo

    GetDeclaredMembers(Type)

    Declaration
    public static MemberInfo[] GetDeclaredMembers(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    MemberInfo[]

    GetDeclaredMethod(Type, string)

    Declaration
    public static MethodInfo GetDeclaredMethod(this Type type, string methodName)
    Parameters
    Type Name Description
    Type type
    string methodName
    Returns
    Type Description
    MethodInfo

    GetDeclaredMethods(Type)

    Declaration
    public static MethodInfo[] GetDeclaredMethods(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    MethodInfo[]

    GetDeclaredProperties(Type)

    Declaration
    public static PropertyInfo[] GetDeclaredProperties(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    PropertyInfo[]

    GetDeclaredProperty(Type, string)

    Declaration
    public static PropertyInfo GetDeclaredProperty(this Type type, string propertyName)
    Parameters
    Type Name Description
    Type type
    string propertyName
    Returns
    Type Description
    PropertyInfo

    GetFlattenedMember(Type, string)

    Declaration
    public static MemberInfo[] GetFlattenedMember(this Type type, string memberName)
    Parameters
    Type Name Description
    Type type
    string memberName
    Returns
    Type Description
    MemberInfo[]

    GetFlattenedMethod(Type, string)

    Declaration
    public static MethodInfo GetFlattenedMethod(this Type type, string methodName)
    Parameters
    Type Name Description
    Type type
    string methodName
    Returns
    Type Description
    MethodInfo

    GetFlattenedMethods(Type, string)

    Declaration
    public static IEnumerable<MethodInfo> GetFlattenedMethods(this Type type, string methodName)
    Parameters
    Type Name Description
    Type type
    string methodName
    Returns
    Type Description
    IEnumerable<MethodInfo>

    GetFlattenedProperty(Type, string)

    Declaration
    public static PropertyInfo GetFlattenedProperty(this Type type, string propertyName)
    Parameters
    Type Name Description
    Type type
    string propertyName
    Returns
    Type Description
    PropertyInfo

    HasAttribute(MemberInfo, Type)

    Returns true if the given attribute is defined on the given element.

    Declaration
    public static bool HasAttribute(MemberInfo element, Type attributeType)
    Parameters
    Type Name Description
    MemberInfo element
    Type attributeType
    Returns
    Type Description
    bool

    HasAttribute(MemberInfo, Type, bool)

    Returns true if the given attribute is defined on the given element.

    Declaration
    public static bool HasAttribute(MemberInfo element, Type attributeType, bool shouldCache)
    Parameters
    Type Name Description
    MemberInfo element
    Type attributeType
    bool shouldCache
    Returns
    Type Description
    bool

    HasAttribute<TAttribute>(MemberInfo)

    Returns true if the given attribute is defined on the given element.

    Declaration
    public static bool HasAttribute<TAttribute>(MemberInfo element)
    Parameters
    Type Name Description
    MemberInfo element
    Returns
    Type Description
    bool
    Type Parameters
    Name Description
    TAttribute

    HasAttribute<TAttribute>(MemberInfo, bool)

    Returns true if the given attribute is defined on the given element.

    Declaration
    public static bool HasAttribute<TAttribute>(MemberInfo element, bool shouldCache)
    Parameters
    Type Name Description
    MemberInfo element
    bool shouldCache
    Returns
    Type Description
    bool
    Type Parameters
    Name Description
    TAttribute

    IsType(MemberInfo)

    Declaration
    public static bool IsType(MemberInfo member)
    Parameters
    Type Name Description
    MemberInfo member
    Returns
    Type Description
    bool

    Resolve(Type)

    Declaration
    public static Type Resolve(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    Type
    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)