Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

TypeIndex

struct in Unity.Entities

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Provides a unique id for component types as well as quick lookup information about the component type itself. This value is fully deterministic at runtime but should not be considered deterministic across builds and thus should not be serialized. For serialization, please prefer TypeManager.TypeInfo.StableTypeHash instead.

Static Properties

Property Description
Null An invalid TypeIndex which does not map to a valid component type.

Properties

Property Description
Flags Type flags stored in Value
HasEntityReferences The component type contains an Entity member. Entity members found in nested member types will also cause this property to return true.
HasNativeContainer The component type contains a NativeContainerAttribute decorated member. NativeContainer members found in nested member types will also cause this property to return true.
HasOnAddedCallback The component type has an OnAddedCallback.
HasOnRemovedCallback The component type has an OnRemovedCallback.
Index Zero-based index for the TypeIndex stored in Value (the type index with no flags).
IsBakingOnlyType The component type is decorated with the BakingTypeAttribute attribute.
IsBuffer The component type inherits from IBufferElementData
IsChunkComponent The component type is used as a chunk component (a component mapped to a Chunk rather than Entity)
IsChunkSerializable The component type is appropriate for chunk serialization. Such types are blittable without containing pointer types or have been decorated with ChunkSerializableAttribute.
IsCleanupBufferComponent The component type inherits from ICleanupBufferElementData
IsCleanupComponent The component type inherits from ICleanupComponentData
IsCleanupSharedComponent The component type inherits from ICleanupSharedComponentData
IsComponentType The component type inherits from IComponentData
IsEnableable The component type inherits from IEnableableComponent
IsIEquatable The component type inherits from IEquatable_1
IsRefCounted The component type inherits from IRefCounted
IsSharedComponentType The component type inherits from ISharedComponentData
IsTemporaryBakingType The component type is decorated with the TemporaryBakingTypeAttribute attribute.
IsTransform The component type is a transform type
IsZeroSized The component type allocates 0 bytes in Chunk storage
Value Raw value used to identify Component types at runtime. This value should not be serialized as it is not guaranteed to be deterministic across builds (but is during runtime). For deterministic serialization of types please use TypeManager.TypeInfo.StableTypeHash

Public Methods

Method Description
CompareTo Compare this TypeIndex against a given one
Equals TypeIndex instances are equal if they refer to the same component type instance.
GetHashCode A hash used for comparisons.
ToFixedString Provides a Burst compatible debugging string.
ToString Provides a debugging string.

Operators

Operator Description
int Implicit conversion from TypeIndex to an int.
operator != TypeIndex instances are equal if they refer to the same component type instance.
operator < Evaluates if one TypeIndex is less than the other.
operator <= Evaluates if one TypeIndex is less than or equal to the other.
operator == TypeIndex instances are equal if they refer to the same component type instance.
operator > Evaluates if one TypeIndex is greater than the other.
operator >= Evaluates if one TypeIndex is greater than or equal to the other.
TypeIndex Implicit conversion from an int to a TypeIndex.