docs.unity3d.com
    Show / Hide Table of Contents

    Class TypeTraits<T>

    Helper class to avoid paying the cost of runtime type lookups.

    This is also used to abstract underlying type info in the runtime (e.g. RuntimeTypeHandle vs StaticTypeReg)

    Inheritance
    Object
    TypeTraits<T>
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Properties
    Syntax
    public static class TypeTraits<T>
    Type Parameters
    Name Description
    T

    The type.

    Properties

    CanBeNull

    Gets a value indicating whether can be null. i.e. The type is an object or nullable.

    Declaration
    public static bool CanBeNull { get; }
    Property Value
    Type Description
    Boolean

    IsAbstract

    Gets a value indicating whether is an abstract type.

    Declaration
    public static bool IsAbstract { get; }
    Property Value
    Type Description
    Boolean

    IsAbstractOrInterface

    Gets a value indicating whether is an abstract or interface type.

    Declaration
    public static bool IsAbstractOrInterface { get; }
    Property Value
    Type Description
    Boolean

    IsArray

    Gets a value indicating whether is an array type.

    Declaration
    public static bool IsArray { get; }
    Property Value
    Type Description
    Boolean

    IsContainer

    Gets a value indicating whether is a property container type.

    Declaration
    public static bool IsContainer { get; }
    Property Value
    Type Description
    Boolean

    IsEnum

    Gets a value indicating whether is an enum type.

    Declaration
    public static bool IsEnum { get; }
    Property Value
    Type Description
    Boolean

    IsEnumFlags

    Gets a value indicating whether is an flags enum type.

    Declaration
    public static bool IsEnumFlags { get; }
    Property Value
    Type Description
    Boolean

    IsInterface

    Gets a value indicating whether is an interface type.

    Declaration
    public static bool IsInterface { get; }
    Property Value
    Type Description
    Boolean

    IsLazyLoadReference

    Gets a value indicating whether is a LazyLoadReference`1 type.

    Declaration
    public static bool IsLazyLoadReference { get; }
    Property Value
    Type Description
    Boolean

    IsMultidimensionalArray

    Gets a value indicating whether is a multidimensional array type.

    Declaration
    public static bool IsMultidimensionalArray { get; }
    Property Value
    Type Description
    Boolean

    IsNullable

    Gets a value indicating whether is a nullable type.

    Declaration
    public static bool IsNullable { get; }
    Property Value
    Type Description
    Boolean

    IsObject

    Gets a value indicating whether is Object type.

    Declaration
    public static bool IsObject { get; }
    Property Value
    Type Description
    Boolean

    IsPrimitive

    Gets a value indicating whether is a primitive type.

    Declaration
    public static bool IsPrimitive { get; }
    Property Value
    Type Description
    Boolean

    IsPrimitiveOrString

    Gets a value indicating whether is a primitive or String type.

    Declaration
    public static bool IsPrimitiveOrString { get; }
    Property Value
    Type Description
    Boolean

    IsString

    Gets a value indicating whether is String type.

    Declaration
    public static bool IsString { get; }
    Property Value
    Type Description
    Boolean

    IsUnityObject

    Gets a value indicating whether is a Object type.

    Declaration
    public static bool IsUnityObject { get; }
    Property Value
    Type Description
    Boolean

    IsValueType

    Gets a value indicating whether is a value type.

    Declaration
    public static bool IsValueType { get; }
    Property Value
    Type Description
    Boolean
    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