Search Results for

    Show / Hide Table of Contents

    Class TypeExtensions

    Inheritance
    object
    TypeExtensions
    Namespace: TetraCreations.Core
    Assembly: cs.temp.dll.dll
    Syntax
    public static class TypeExtensions

    Methods

    GetMethod(Type, string)

    Returns the MethodInfo using the method name

    Declaration
    public static MethodInfo GetMethod(this Type type, string name)
    Parameters
    Type Name Description
    Type type
    string name

    Method name

    Returns
    Type Description
    MethodInfo

    GetTypeName(Type)

    Get the type name for the asset database if it's from the Engine, otherwise return the FullName

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

    HasFlagsAttribute(Type)

    Determines whether an Enum type has the [Flags] attribute

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

    Implements(Type, Type)

    Determines whether a type implements an interface.

    Declaration
    public static bool Implements(this Type source, Type interfaceType)
    Parameters
    Type Name Description
    Type source
    Type interfaceType
    Returns
    Type Description
    bool

    Implements<T>(Type)

    Determines whether a type implements an interface.

    Declaration
    public static bool Implements<T>(this Type source)
    Parameters
    Type Name Description
    Type source
    Returns
    Type Description
    bool
    Type Parameters
    Name Description
    T

    The interface Type

    IsAnonymous(Type)

    Determines whether a Type is anonym, it means the type name is generated by the compiler and is not available at the source code level. https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/types/anonymous-types

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

    IsCompilerGenerated(Type)

    Determines whether a Type is a compiler-generated element.

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

    IsEnum(Type)

    Determines whether the Type is an enum

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

    IsFromUnity(Type)

    Determines if the type is from the UnityEngine or UnityEditor namespaces

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

    IsFromUnityEditor(Type)

    Determines if the type is from the UnityEditor namespace

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

    IsFromUnityEngine(Type)

    Determines if the type is from the UnityEngine namespace

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

    IsImplementedBy(Type, Type)

    Determines whether a type implements another

    Declaration
    public static bool IsImplementedBy(this Type type, Type other)
    Parameters
    Type Name Description
    Type type
    Type other
    Returns
    Type Description
    bool
    In This Article
    Back to top Tetra Creations documentation