docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class TypeUtility

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

    Methods

    AndBaseTypeAndInterfaces(Type)

    Declaration
    public static IEnumerable<Type> AndBaseTypeAndInterfaces(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    IEnumerable<Type>

    AndHierarchy(Type)

    Declaration
    public static IEnumerable<Type> AndHierarchy(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    IEnumerable<Type>

    AndInterfaces(Type)

    Declaration
    public static IEnumerable<Type> AndInterfaces(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    IEnumerable<Type>

    BaseTypeAndInterfaces(Type, bool)

    Declaration
    public static IEnumerable<Type> BaseTypeAndInterfaces(this Type type, bool inheritedInterfaces = true)
    Parameters
    Type Name Description
    Type type
    bool inheritedInterfaces
    Returns
    Type Description
    IEnumerable<Type>

    CanMakeGenericTypeVia(Type, Type)

    Declaration
    public static bool CanMakeGenericTypeVia(this Type openConstructedType, Type closedConstructedType)
    Parameters
    Type Name Description
    Type openConstructedType
    Type closedConstructedType
    Returns
    Type Description
    bool

    Default(Type)

    Declaration
    public static object Default(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    object

    GetDictionaryItemType(Type, bool, int)

    Declaration
    public static Type GetDictionaryItemType(Type dictionaryType, bool allowNonGeneric, int genericArgumentIndex)
    Parameters
    Type Name Description
    Type dictionaryType
    bool allowNonGeneric
    int genericArgumentIndex
    Returns
    Type Description
    Type

    GetDictionaryKeyType(Type, bool)

    Declaration
    public static Type GetDictionaryKeyType(Type dictionaryType, bool allowNonGeneric)
    Parameters
    Type Name Description
    Type dictionaryType
    bool allowNonGeneric
    Returns
    Type Description
    Type

    GetDictionaryValueType(Type, bool)

    Declaration
    public static Type GetDictionaryValueType(Type dictionaryType, bool allowNonGeneric)
    Parameters
    Type Name Description
    Type dictionaryType
    bool allowNonGeneric
    Returns
    Type Description
    Type

    GetEnumerableElementType(Type, bool)

    Declaration
    public static Type GetEnumerableElementType(Type enumerableType, bool allowNonGeneric)
    Parameters
    Type Name Description
    Type enumerableType
    bool allowNonGeneric
    Returns
    Type Description
    Type

    GetInterfaces(Type, bool)

    Declaration
    public static IEnumerable<Type> GetInterfaces(this Type type, bool includeInherited)
    Parameters
    Type Name Description
    Type type
    bool includeInherited
    Returns
    Type Description
    IEnumerable<Type>

    GetListElementType(Type, bool)

    Declaration
    public static Type GetListElementType(Type listType, bool allowNonGeneric)
    Parameters
    Type Name Description
    Type listType
    bool allowNonGeneric
    Returns
    Type Description
    Type

    GetTypesSafely(Assembly)

    Declaration
    public static IEnumerable<Type> GetTypesSafely(this Assembly assembly)
    Parameters
    Type Name Description
    Assembly assembly
    Returns
    Type Description
    IEnumerable<Type>

    Hierarchy(Type)

    Declaration
    public static IEnumerable<Type> Hierarchy(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    IEnumerable<Type>

    Instantiate(Type, bool, params object[])

    Declaration
    public static object Instantiate(this Type type, bool nonPublic = true, params object[] args)
    Parameters
    Type Name Description
    Type type
    bool nonPublic
    object[] args
    Returns
    Type Description
    object

    Instantiator(Type, bool)

    Declaration
    public static Func<object> Instantiator(this Type type, bool nonPublic = true)
    Parameters
    Type Name Description
    Type type
    bool nonPublic
    Returns
    Type Description
    Func<object>

    Instantiator(Type, bool, params Type[])

    Declaration
    public static Func<object[], object> Instantiator(this Type type, bool nonPublic = true, params Type[] parameterTypes)
    Parameters
    Type Name Description
    Type type
    bool nonPublic
    Type[] parameterTypes
    Returns
    Type Description
    Func<object[], object>

    IsAbstract(Type)

    Declaration
    public static bool IsAbstract(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    bool

    IsAssignableFrom(Type, object)

    Declaration
    public static bool IsAssignableFrom(this Type type, object value)
    Parameters
    Type Name Description
    Type type
    object value
    Returns
    Type Description
    bool

    IsBasic(Type)

    Declaration
    public static bool IsBasic(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    bool

    IsConcrete(Type)

    Declaration
    public static bool IsConcrete(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    bool

    IsNullable(Type)

    Declaration
    public static bool IsNullable(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    bool

    IsNumeric(Type)

    Declaration
    public static bool IsNumeric(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    bool

    IsNumericConstruct(Type)

    Declaration
    public static bool IsNumericConstruct(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    bool

    IsReferenceType(Type)

    Declaration
    public static bool IsReferenceType(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    bool

    IsStatic(Type)

    Declaration
    public static bool IsStatic(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    bool

    IsStruct(Type)

    Declaration
    public static bool IsStruct(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    bool

    MakeGenericTypeVia(Type, Type, Dictionary<Type, Type>, bool)

    Declaration
    public static Type MakeGenericTypeVia(this Type openConstructedType, Type closedConstructedType, Dictionary<Type, Type> resolvedGenericParameters, bool safe = true)
    Parameters
    Type Name Description
    Type openConstructedType
    Type closedConstructedType
    Dictionary<Type, Type> resolvedGenericParameters
    bool safe
    Returns
    Type Description
    Type

    Namespace(Type)

    Declaration
    public static Namespace Namespace(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    Namespace

    PseudoDefault(Type)

    Declaration
    public static object PseudoDefault(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    object

    ToShortString(object, int)

    Declaration
    public static string ToShortString(this object o, int maxLength = 20)
    Parameters
    Type Name Description
    object o
    int maxLength
    Returns
    Type Description
    string

    TryInstantiate(Type, bool, params object[])

    Declaration
    public static object TryInstantiate(this Type type, bool nonPublic = true, params object[] args)
    Parameters
    Type Name Description
    Type type
    bool nonPublic
    object[] args
    Returns
    Type Description
    object
    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)