Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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)
Read time 1 minuteLast updated 9 days ago

Definition

  • Type: Class
  • Namespace: Unity.Properties
  • Assembly: UnityEngine.PropertiesModule
public static class TypeTraits<T>

Static Properties

Property

Description

CanBeNullGets a value indicating whether T can be null. i.e. The type is an object or nullable.
IsAbstractGets a value indicating whether T is an abstract type.
IsAbstractOrInterfaceGets a value indicating whether T is an abstract or interface type.
IsArrayGets a value indicating whether T is an array type.
IsContainerGets a value indicating whether T is a property container type.
IsEnumGets a value indicating whether T is an enum type.
IsEnumFlagsGets a value indicating whether T is an flags enum type.
IsInterfaceGets a value indicating whether T is an interface type.
IsLazyLoadReferenceGets a value indicating whether T is a LazyLoadReference_1 type.
IsMultidimensionalArrayGets a value indicating whether T is a multidimensional array type.
IsNullableGets a value indicating whether T is a nullable type.
IsObjectGets a value indicating whether T is Object type.
IsPrimitiveGets a value indicating whether T is a primitive type.
IsPrimitiveOrStringGets a value indicating whether T is a primitive or string type.
IsStringGets a value indicating whether T is string type.
IsUnityObjectGets a value indicating whether T is a Object type.
IsValueTypeGets a value indicating whether T is a value type.