docs.unity3d.com
    Show / Hide Table of Contents

    Class ReflectionUtils

    Inheritance
    Object
    ReflectionUtils
    Namespace: Unity.Reflect
    Syntax
    public static class ReflectionUtils

    Methods

    AreRelated(Type, Type)

    Check if 2 types are related through interface implementation, parent/child relation or if they are the same type.

    Declaration
    public static bool AreRelated(Type t1, Type t2)
    Parameters
    Type Name Description
    Type t1
    Type t2
    Returns
    Type Description
    Boolean

    ExtractTypes(String)

    Convert a type (string) to an hierarchy of ReflectionUtils.StringTypeElem, effectively extracting general information about the string.

    Declaration
    public static ReflectionUtils.StringTypeElem ExtractTypes(string fullName)
    Parameters
    Type Name Description
    String fullName

    The full name of the type, including generic type if there is any.

    Returns
    Type Description
    ReflectionUtils.StringTypeElem

    FlushCache()

    Declaration
    public static void FlushCache()

    GetClosedTypeFromAnyAssembly(String)

    Get the closed type for the received.

    Declaration
    public static Type GetClosedTypeFromAnyAssembly(string closedType)
    Parameters
    Type Name Description
    String closedType

    The type as a string without the assembly qualifier e.g. "System.Int32", "System.Collections.Generic.List`1[System.Int32]"

    Returns
    Type Description
    Type

    The type found in any loaded assembly.

    Remarks

    This method works with nested generic type. If the string is not a closed type, this method may throw. If the type does not exist, this method may throw.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023