Struct ComponentType
A struct to define a component including how it's accessed and what type of component it is
Namespace: Unity.Entities
Syntax
[GenerateTestsForBurstCompatibility]
public struct ComponentType : IEquatable<ComponentType>, IComparable<ComponentType>
Constructors
| Name | Description |
|---|---|
| ComponentType(Type, ComponentType.AccessMode) | Create a component type |
Fields
| Name | Description |
|---|---|
| AccessModeType | The way the component type will be accessed |
| TypeIndex | A unique index of the component type |
Properties
| Name | Description |
|---|---|
| HasEntityReferences | True if any of the fields in the component type are type Entity |
| HasNativeContainer | The component type contains a NativeContainerAttribute decorated member. NativeContainer members found in nested member types will also cause this property to return true. |
| IsBuffer | True if the component type is a IBufferElementData |
| IsChunkComponent | True if the component type is flagged as a chunk component type |
| IsChunkSerializable | True if the component type is appropriate for chunk serialization. Such types are blittable without containing pointer types or have been decorated with ChunkSerializableAttribute. |
| IsCleanupBufferComponent | Bitflag set for component types inheriting from ICleanupBufferElementData. |
| IsCleanupComponent | True if the component type is a ICleanupComponentData |
| IsCleanupSharedComponent | True if the component type is a ICleanupSharedComponentData |
| IsComponent | True if the component type is a IComponentData |
| IsEnableable | True if the component type is a IEnableableComponent |
| IsManagedComponent | True if the component type is a managed component |
| IsSharedComponent | True if the component type is a ISharedComponentData |
| IsSystemStateComponent | Obsolete. Use IsCleanupComponent instead. |
| IsSystemStateSharedComponent | Obsolete. Use IsCleanupComponent instead. |
| IsZeroSized | True if the component type does not contain actual fields or data |
Methods
| Name | Description |
|---|---|
| ChunkComponent(Type) | Returns a ComponentType that is a chunk component with ReadWrite based on the type. |
| ChunkComponent<T>() | Returns a ComponentType that is a chunk component with ReadWrite based on the type. |
| ChunkComponentExclude(Type) | Returns a ComponentType that is a chunk component with Exclude based on the type. |
| ChunkComponentExclude<T>() | Returns a ComponentType that is a chunk component with Exclude based on the type. |
| ChunkComponentReadOnly(Type) | Returns a ComponentType that is a chunk component with ReadOnly based on the type. |
| ChunkComponentReadOnly<T>() | Returns a ComponentType that is a chunk component with ReadOnly based on the type. |
| Combine(ComponentType[][]) | Combine multiple array of component type into one. Duplicate types are removed. It will allocate an array containing all component type. Useful for creating queries during initialization of systems. |
| CompareTo(ComponentType) | Returns the sort order this component type compared to another |
| Equals(Object) | Checks to see if an object is equal to this component type. |
| Equals(ComponentType) | Checks if this component type has the same TypeIndex as the other component type. |
| Exclude(Type) | Returns a ComponentType with Exclude based on the type. |
| Exclude(TypeIndex) | Returns a ComponentType with Exclude based on the typeIndex. |
| Exclude<T>() | Returns a ComponentType with Exclude based on the generic type T. |
| FromTypeIndex(TypeIndex) | Returns a ComponentType with ReadWrite based on the typeIndex |
| GetHashCode() | Gets the hash code for this component type |
| GetManagedType() | |
| ReadOnly(Type) | Returns a ComponentType with ReadOnly based on the type. |
| ReadOnly(TypeIndex) | Returns a ComponentType with ReadOnly based on the typeIndex. |
| ReadOnly<T>() | Returns a ComponentType with ReadOnly based on the generic type T. |
| ReadWrite(Type) | Returns a ComponentType with ReadWrite based on the type. |
| ReadWrite(TypeIndex) | Returns a ComponentType with ReadWrite based on the typeIndex. |
| ReadWrite<T>() | Returns a ComponentType with ReadWrite based on the generic type T. |
| ToFixedString() | Returns a fixed string of the component type |
| ToString() | Returns a managed string of the component type |
Operators
| Name | Description |
|---|---|
| Equality(ComponentType, ComponentType) | Evaluates if two component types are equal based on TypeIndex and AccessModeType. |
| GreaterThan(ComponentType, ComponentType) | Evaluates if one component type is greater than the the other. |
| Implicit(Type to ComponentType) | Creates a new component type based on the type passed in |
| Inequality(ComponentType, ComponentType) | Evaluates if two component types are not equal based on TypeIndex and AccessModeType. |
| LessThan(ComponentType, ComponentType) | Evaluates if one component type is less than the the other first by TypeIndex, then by ComponentType.AccessMode. |