Struct TypeIndex
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 StableTypeHash instead.
Namespace: Unity.Entities
Assembly: solution.dll
Syntax
public struct TypeIndex
Fields
Name | Description |
---|---|
Value | Raw value used to identify Component types at runtime.
|
Properties
Name | 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. |
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<T> |
IsManagedComponent | The component type IsManagedType and inherits from IComponentData |
IsManagedSharedComponent | The component type IsManagedType and inherits from ISharedComponentData |
IsManagedType | The component type requires managed storage due to being a class type, and/or contains reference types |
IsRefCounted | The component type inherits from IRefCounted |
IsSharedComponentType | The component type inherits from ISharedComponentData |
IsTemporaryBakingType | The component type is decorated with the TemporaryBakingTypeAttribute attribute. |
IsZeroSized | The component type allocates 0 bytes in Chunk storage |
Null | An invalid TypeIndex which does not map to a valid component type. |
Methods
Name | Description |
---|---|
CompareTo(TypeIndex) | Compare this TypeIndex against a given one |
Equals(object) | TypeIndex instances are equal if they refer to the same component type instance. |
Equals(TypeIndex) | 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
Name | Description |
---|---|
operator ==(TypeIndex, TypeIndex) | TypeIndex instances are equal if they refer to the same component type instance. |
operator >(TypeIndex, TypeIndex) | Evaluates if one TypeIndex is greater than the other. |
operator >=(TypeIndex, TypeIndex) | Evaluates if one TypeIndex is greater than or equal to the other. |
implicit operator TypeIndex(int) | Implicit conversion from an int to a TypeIndex. |
implicit operator int(TypeIndex) | Implicit conversion from TypeIndex to an int. |
operator !=(TypeIndex, TypeIndex) | TypeIndex instances are equal if they refer to the same component type instance. |
operator <(TypeIndex, TypeIndex) | Evaluates if one TypeIndex is less than the other. |
operator <=(TypeIndex, TypeIndex) | Evaluates if one TypeIndex is less than or equal to the other. |