Struct ArchetypeChunk
A block of unmanaged memory containing the components for entities sharing the same Archetype.
Namespace: Unity.Entities
Syntax
public struct ArchetypeChunk : IEquatable<ArchetypeChunk>
Properties
Archetype
The archetype of the entities stored in this chunk.
Declaration
public EntityArchetype Archetype { get; }
Property Value
Type | Description |
---|---|
EntityArchetype |
Remarks
All entities in a chunk must have the same Archetype.
Capacity
The number of entities that can fit in this chunk.
Declaration
public int Capacity { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
The capacity of a chunk depends on the size of the components making up the Archetype of the entities stored in the chunk.
ChunkEntityCount
The number of entities currently stored in the chunk (ignoring any sub-batching)
Declaration
public int ChunkEntityCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Count
If the ArchetypeChunk is not sub-batched, returns the number of entities in the chunk. Otherwise, returns the number of entities referenced by this batch.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
Full
Whether this chunk is exactly full.
Declaration
public bool Full { get; }
Property Value
Type | Description |
---|---|
Boolean |
Null
A special "null" ArchetypeChunk that you can use to test whether ArchetypeChunk instances are valid.
Declaration
public static ArchetypeChunk Null { get; }
Property Value
Type | Description |
---|---|
ArchetypeChunk |
Remarks
An ArchetypeChunk struct that refers to a chunk of memory that has been freed will be equal to this "null" ArchetypeChunk instance.
Methods
DidChange(DynamicComponentTypeHandle, UInt32)
Reports whether the data in any of IComponentData components in the chunk, of the type identified by
chunkComponentType
, could have changed since the specified version.
Declaration
public bool DidChange(DynamicComponentTypeHandle chunkComponentType, uint version)
Parameters
Type | Name | Description |
---|---|---|
DynamicComponentTypeHandle | chunkComponentType | An object containing type and job safety information. Create this object by calling GetDynamicComponentTypeHandle(ComponentType) immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
UInt32 | version | The version to compare. In a system, this parameter should be set to the current LastSystemVersion at the time the job is run or scheduled. |
Returns
Type | Description |
---|---|
Boolean | True, if the version number stored in the chunk for this component is more recent than the version
passed to the |
Remarks
When you access a component in a chunk with write privileges, the ECS framework updates the change version of that component type to the current GlobalSystemVersion value. Since every system stores the global system version in its LastSystemVersion field when it updates, you can compare these two versions with this function in order to determine whether the data of components in this chunk could have changed since the last time that system ran.
Note that for efficiency, the change version applies to whole chunks not individual entities. The change version is updated even when another job or system that has declared write access to a component does not actually change the component value.
DidChange<T>(BufferTypeHandle<T>, UInt32)
Reports whether any of the data in dynamic buffer components in the chunk, of the type identified by
chunkBufferTypeHandle
, could have changed since the specified version.
Declaration
public bool DidChange<T>(BufferTypeHandle<T> chunkBufferTypeHandle, uint version)
where T : struct, IBufferElementData
Parameters
Type | Name | Description |
---|---|---|
BufferTypeHandle<T> | chunkBufferTypeHandle | An object containing type and job safety information. Create this object by calling GetBufferTypeHandle<T>(Boolean) immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
UInt32 | version | The version to compare. In a system, this parameter should be set to the current LastSystemVersion at the time the job is run or scheduled. |
Returns
Type | Description |
---|---|
Boolean | True, if the version number stored in the chunk for this component is more recent than the version
passed to the |
Type Parameters
Name | Description |
---|---|
T | The data type of the elements in the dynamic buffer. |
Remarks
When you access a component in a chunk with write privileges, the ECS framework updates the change version of that component type to the current GlobalSystemVersion value. Since every system stores the global system version in its LastSystemVersion field when it updates, you can compare these two versions with this function in order to determine whether the data of components in this chunk could have changed since the last time that system ran.
Note that for efficiency, the change version applies to whole chunks not individual entities. The change version is updated even when another job or system that has declared write access to a component does not actually change the component value.
DidChange<T>(ComponentTypeHandle<T>, UInt32)
Reports whether the data in any of IComponentData components in the chunk, of the type identified by
chunkComponentTypeHandle
, could have changed since the specified version.
Declaration
public bool DidChange<T>(ComponentTypeHandle<T> chunkComponentTypeHandle, uint version)
where T : IComponentData
Parameters
Type | Name | Description |
---|---|---|
ComponentTypeHandle<T> | chunkComponentTypeHandle | An object containing type and job safety information. Create this object by calling GetComponentTypeHandle<T>(Boolean) immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
UInt32 | version | The version to compare. In a system, this parameter should be set to the current LastSystemVersion at the time the job is run or scheduled. |
Returns
Type | Description |
---|---|
Boolean | True, if the version number stored in the chunk for this component is more recent than the version
passed to the |
Type Parameters
Name | Description |
---|---|
T | The component type. |
Remarks
When you access a component in a chunk with write privileges, the ECS framework updates the change version of that component type to the current GlobalSystemVersion value. Since every system stores the global system version in its LastSystemVersion field when it updates, you can compare these two versions with this function in order to determine whether the data of components in this chunk could have changed since the last time that system ran.
Note that for efficiency, the change version applies to whole chunks not individual entities. The change version is updated even when another job or system that has declared write access to a component does not actually change the component value.
DidChange<T>(SharedComponentTypeHandle<T>, UInt32)
Reports whether the value of shared components associated with the chunk, of the type identified by
chunkSharedComponentData
, could have changed since the specified version.
Declaration
public bool DidChange<T>(SharedComponentTypeHandle<T> chunkSharedComponentData, uint version)
where T : struct, ISharedComponentData
Parameters
Type | Name | Description |
---|---|---|
SharedComponentTypeHandle<T> | chunkSharedComponentData | An object containing type and job safety information. Create this object by calling GetSharedComponentTypeHandle<T>() immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
UInt32 | version | The version to compare. In a system, this parameter should be set to the current LastSystemVersion at the time the job is run or scheduled. |
Returns
Type | Description |
---|---|
Boolean | True, if the version number stored in the chunk for this component is more recent than the version
passed to the |
Type Parameters
Name | Description |
---|---|
T | The data type of the shared component. |
Remarks
Shared components behave differently than other types of components in terms of change versioning because changing the value of a shared component can move an entity to a different chunk. If the change results in an entity moving to a different chunk, then only the order version is updated (for both the original and the receiving chunk). If you change the shared component value for all entities in a chunk at once, the change version for that chunk is updated. The order version is unaffected.
Note that for efficiency, the change version applies to whole chunks not individual entities. The change version is updated even when another job or system that has declared write access to a component does not actually change the component value.
DidOrderChange(UInt32)
Reports whether a structural change has occured in this chunk since the specified version.
Declaration
public bool DidOrderChange(uint version)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | version | The version number to compare. |
Returns
Type | Description |
---|---|
Boolean | True, if the order version number has changed since the specified version. |
Remarks
Typically, you set the version
parameter to the
LastSystemVersion of a system to detect whether the order version
has changed since the last time that system ran.
Equals(Object)
Two ArchetypeChunk instances are equal if they reference the same block of chunk memory.
Declaration
public override bool Equals(object compare)
Parameters
Type | Name | Description |
---|---|---|
Object | compare | An object |
Returns
Type | Description |
---|---|
Boolean | True if |
Overrides
Equals(ArchetypeChunk)
Two ArchetypeChunk instances are equal if they reference the same block of chunk and entity component store memory.
Declaration
public bool Equals(ArchetypeChunk archetypeChunk)
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunk | archetypeChunk | Another ArchetypeChunk instance |
Returns
Type | Description |
---|---|
Boolean | True, if both ArchetypeChunk instances reference the same memory or both contain null memory references. |
GetBufferAccessor<T>(BufferTypeHandle<T>)
Declaration
public BufferAccessor<T> GetBufferAccessor<T>(BufferTypeHandle<T> bufferComponentTypeHandle)
where T : struct, IBufferElementData
Parameters
Type | Name | Description |
---|---|---|
BufferTypeHandle<T> | bufferComponentTypeHandle |
Returns
Type | Description |
---|---|
BufferAccessor<T> |
Type Parameters
Name | Description |
---|---|
T |
GetChangeVersion(DynamicComponentTypeHandle)
Gets the change version number assigned to the specified type of component in this chunk.
Declaration
public uint GetChangeVersion(DynamicComponentTypeHandle chunkComponentType)
Parameters
Type | Name | Description |
---|---|---|
DynamicComponentTypeHandle | chunkComponentType | An object containing type and job safety information. Create this object by calling GetDynamicComponentTypeHandle(ComponentType) immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
Returns
Type | Description |
---|---|
UInt32 | The current version number of the specified component, which is the version set the last time a system accessed a component of that type in this chunk with write privileges. Returns 0 if the chunk does not contain a component of the specified type. |
Remarks
Every time a system accesses components in a chunk, the system updates the change version of any component types to which it has write access with the current GlobalSystemVersion. (A system updates the version whether or not you actually write any component data -- always specify read-only access when possible.)
You can use the change version to filter out entities that have not changed since the last time a system ran. Implement change filtering using one of the following:
- Entities.ForEach.WithChangeFilter(ComponentType)
- AddChangedVersionFilter(ComponentType)
- DidChange<T>(ComponentTypeHandle<T>, UInt32) in an IJobChunk job.
Note that change versions are stored at the chunk level. Thus when you use change filtering, the query system excludes or includes whole chunks not individual entities.
GetChangeVersion<T>(BufferTypeHandle<T>)
Gets the change version number assigned to the specified type of dynamic buffer component in this chunk.
Declaration
public uint GetChangeVersion<T>(BufferTypeHandle<T> chunkBufferTypeHandle)
where T : struct, IBufferElementData
Parameters
Type | Name | Description |
---|---|---|
BufferTypeHandle<T> | chunkBufferTypeHandle | An object containing type and job safety information. Create this object by calling GetBufferTypeHandle<T>(Boolean) immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
Returns
Type | Description |
---|---|
UInt32 | The current version number of the specified dynamic buffer type, which is the version set the last time a system accessed a buffer component of that type in this chunk with write privileges. Returns 0 if the chunk does not contain a buffer component of the specified type. |
Type Parameters
Name | Description |
---|---|
T | The data type of component T. |
Remarks
Every time a system accesses components in a chunk, the system updates the change version of any component types to which it has write access with the current GlobalSystemVersion. (A system updates the version whether or not you actually write any component data -- always specify read-only access when possible.)
You can use the change version to filter out entities that have not changed since the last time a system ran. Implement change filtering using one of the following:
- Entities.ForEach.WithChangeFilter(ComponentType)
- AddChangedVersionFilter(ComponentType)
- DidChange<T>(ComponentTypeHandle<T>, UInt32) in an IJobChunk job.
Note that change versions are stored at the chunk level. Thus if you use change filtering, the query system excludes or includes whole chunks not individual entities.
GetChangeVersion<T>(ComponentTypeHandle<T>)
Gets the change version number assigned to the specified type of component in this chunk.
Declaration
public uint GetChangeVersion<T>(ComponentTypeHandle<T> chunkComponentTypeHandle)
where T : IComponentData
Parameters
Type | Name | Description |
---|---|---|
ComponentTypeHandle<T> | chunkComponentTypeHandle | An object containing type and job safety information. Create this object by calling GetComponentTypeHandle<T>(Boolean) immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
Returns
Type | Description |
---|---|
UInt32 | The current version number of the specified component, which is the version set the last time a system accessed a component of that type in this chunk with write privileges. Returns 0 if the chunk does not contain a component of the specified type. |
Type Parameters
Name | Description |
---|---|
T | The data type of component T. |
Remarks
Every time a system accesses components in a chunk, the system updates the change version of any component types to which it has write access with the current GlobalSystemVersion. (A system updates the version whether or not you actually write any component data -- always specify read-only access when possible.)
You can use the change version to filter out entities that have not changed since the last time a system ran. Implement change filtering using one of the following:
- Entities.ForEach.WithChangeFilter(ComponentType)
- AddChangedVersionFilter(ComponentType)
- DidChange<T>(ComponentTypeHandle<T>, UInt32) in an IJobChunk job.
Note that change versions are stored at the chunk level. Thus when you use change filtering, the query system excludes or includes whole chunks not individual entities.
GetChangeVersion<T>(SharedComponentTypeHandle<T>)
Gets the change version number assigned to the specified type of shared component in this chunk.
Declaration
public uint GetChangeVersion<T>(SharedComponentTypeHandle<T> chunkSharedComponentData)
where T : struct, ISharedComponentData
Parameters
Type | Name | Description |
---|---|---|
SharedComponentTypeHandle<T> | chunkSharedComponentData | An object containing type and job safety information. Create this object by calling GetSharedComponentTypeHandle<T>() immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
Returns
Type | Description |
---|---|
UInt32 | The current version number of the specified shared component, which is the version set the last time a system accessed a component of that type in this chunk with write privileges. Returns 0 if the chunk does not contain a shared component of the specified type. |
Type Parameters
Name | Description |
---|---|
T | The data type of shared component T. |
Remarks
Shared components behave differently than other types of components in terms of change versioning because changing the value of a shared component can move an entity to a different chunk. If the change results in an entity moving to a different chunk, then only the order version is updated (for both the original and the receiving chunk). If you change the shared component value for all entities in a chunk at once, the entities remain in their current chunk. The change version for that chunk is updated and the order version is unaffected.
GetChunkComponentData<T>(ComponentTypeHandle<T>)
Gets the value of a chunk component.
Declaration
public T GetChunkComponentData<T>(ComponentTypeHandle<T> chunkComponentTypeHandle)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
ComponentTypeHandle<T> | chunkComponentTypeHandle | An object containing type and job safety information. Create this object by calling GetComponentTypeHandle<T>(Boolean) immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
Returns
Type | Description |
---|---|
T | A copy of the chunk component. |
Type Parameters
Name | Description |
---|---|
T | The data type of the chunk component. |
GetDynamicComponentDataArrayReinterpret<T>(DynamicComponentTypeHandle, Int32)
Declaration
public NativeArray<T> GetDynamicComponentDataArrayReinterpret<T>(DynamicComponentTypeHandle chunkComponentType, int expectedTypeSize)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
DynamicComponentTypeHandle | chunkComponentType | |
Int32 | expectedTypeSize |
Returns
Type | Description |
---|---|
NativeArray<T> |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentException | |
InvalidOperationException |
GetHashCode()
Computes a hashcode to support hash-based collections.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | The computed hash. |
Overrides
GetManagedComponentAccessor<T>(ComponentTypeHandle<T>, EntityManager)
Declaration
public ManagedComponentAccessor<T> GetManagedComponentAccessor<T>(ComponentTypeHandle<T> componentTypeHandle, EntityManager manager)
where T : class
Parameters
Type | Name | Description |
---|---|---|
ComponentTypeHandle<T> | componentTypeHandle | |
EntityManager | manager |
Returns
Type | Description |
---|---|
ManagedComponentAccessor<T> |
Type Parameters
Name | Description |
---|---|
T |
GetNativeArray(EntityTypeHandle)
Provides a native array interface to entity instances stored in this chunk.
Declaration
public NativeArray<Entity> GetNativeArray(EntityTypeHandle entityTypeHandle)
Parameters
Type | Name | Description |
---|---|---|
EntityTypeHandle | entityTypeHandle | An object containing type and job safety information. Create this object by calling GetEntityTypeHandle() immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
Returns
Type | Description |
---|---|
NativeArray<Entity> | A native array containing the entities in the chunk. |
Remarks
The native array returned by this method references existing data, not a copy.
GetNativeArray<T>(ComponentTypeHandle<T>)
Provides a native array interface to components stored in this chunk.
Declaration
public NativeArray<T> GetNativeArray<T>(ComponentTypeHandle<T> chunkComponentTypeHandle)
where T : struct, IComponentData
Parameters
Type | Name | Description |
---|---|---|
ComponentTypeHandle<T> | chunkComponentTypeHandle | An object containing type and job safety information. Create this object by calling GetComponentTypeHandle<T>(Boolean)immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
Returns
Type | Description |
---|---|
NativeArray<T> | A native array containing the components in the chunk. |
Type Parameters
Name | Description |
---|---|
T | The data type of the component. |
Remarks
The native array returned by this method references existing data, not a copy.
Exceptions
Type | Condition |
---|---|
ArgumentException | If you call this function on a "tag" component type (which is an empty component with no fields). |
GetOrderVersion()
Gets the order version number assigned to this chunk.
Declaration
public uint GetOrderVersion()
Returns
Type | Description |
---|---|
UInt32 | The current order version of this chunk. |
Remarks
Every time you perform a structural change affecting a chunk, the ECS framework updates the order version of the chunk to the current GlobalSystemVersion value. Structural changes include adding and removing entities, adding or removing the component of an entity, and changing the value of a shared component (except when you change the value for all entities in a chunk at the same time).
GetSharedComponentData<T>(SharedComponentTypeHandle<T>, EntityManager)
Gets the current value of a shared component.
Declaration
public T GetSharedComponentData<T>(SharedComponentTypeHandle<T> chunkSharedComponentData, EntityManager entityManager)
where T : struct, ISharedComponentData
Parameters
Type | Name | Description |
---|---|---|
SharedComponentTypeHandle<T> | chunkSharedComponentData | An object containing type and job safety information. Create this object by calling GetSharedComponentTypeHandle<T>() immediately before calling this function. |
EntityManager | entityManager | An EntityManager instance. |
Returns
Type | Description |
---|---|
T | The shared component value. |
Type Parameters
Name | Description |
---|---|
T | The data type of the shared component. |
Remarks
You cannot call this function inside a job.
GetSharedComponentIndex<T>(SharedComponentTypeHandle<T>)
Gets the index into the array of unique values for the specified shared component.
Declaration
public int GetSharedComponentIndex<T>(SharedComponentTypeHandle<T> chunkSharedComponentData)
where T : struct, ISharedComponentData
Parameters
Type | Name | Description |
---|---|---|
SharedComponentTypeHandle<T> | chunkSharedComponentData | An object containing type and job safety information. Create this object by calling GetSharedComponentTypeHandle<T>() immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
Returns
Type | Description |
---|---|
Int32 | The index value, or -1 if the chunk does not contain a shared component of the specified type. |
Type Parameters
Name | Description |
---|---|
T | The data type of the shared component. |
Remarks
Because shared components can contain managed types, you can only access the value index of a shared component inside a job, not the value itself. The index value indexes the array returned by GetAllUniqueSharedComponentData<T>(List<T>). If desired, you can create a native array that mirrors your unique value list, but which contains only unmanaged, blittable data and pass that into an IJobChunk job. The unique value list and a specific index is only valid until a structural change occurs.
Has(DynamicComponentTypeHandle)
Declaration
public bool Has(DynamicComponentTypeHandle chunkComponentType)
Parameters
Type | Name | Description |
---|---|---|
DynamicComponentTypeHandle | chunkComponentType |
Returns
Type | Description |
---|---|
Boolean |
Has<T>(BufferTypeHandle<T>)
Reports whether this chunk contains a dynamic buffer containing the specified component type.
Declaration
public bool Has<T>(BufferTypeHandle<T> chunkBufferTypeHandle)
where T : struct, IBufferElementData
Parameters
Type | Name | Description |
---|---|---|
BufferTypeHandle<T> | chunkBufferTypeHandle | An object containing type and job safety information. Create this object by calling GetBufferTypeHandle<T>(Boolean) immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
Returns
Type | Description |
---|---|
Boolean | True, if this chunk contains an array of the dynamic buffers containing the specified component type. |
Type Parameters
Name | Description |
---|---|
T | The data type of the component stored in the dynamic buffer. |
Remarks
When an EntityQuery includes optional dynamic buffer types (with Any), some chunks returned by the query may have these dynamic buffers components and some may not. Use this function to determine whether or not the current chunk contains one of these optional dynamic buffers.
Has<T>(ComponentTypeHandle<T>)
Reports whether this chunk contains the specified component type.
Declaration
public bool Has<T>(ComponentTypeHandle<T> chunkComponentTypeHandle)
where T : IComponentData
Parameters
Type | Name | Description |
---|---|---|
ComponentTypeHandle<T> | chunkComponentTypeHandle | An object containing type and job safety information. Create this object by calling GetComponentTypeHandle<T>(Boolean) immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
Returns
Type | Description |
---|---|
Boolean | True, if this chunk contains an array of the specified component type. |
Type Parameters
Name | Description |
---|---|
T | The data type of the component. |
Remarks
When an EntityQuery includes optional components (using Any), some chunks returned by the query may contain such components and some may not. Use this function to determine whether or not the current chunk contains one of these optional component types.
Has<T>(SharedComponentTypeHandle<T>)
Reports whether this chunk contains a shared component of the specified component type.
Declaration
public bool Has<T>(SharedComponentTypeHandle<T> chunkComponentTypeHandle)
where T : struct, ISharedComponentData
Parameters
Type | Name | Description |
---|---|---|
SharedComponentTypeHandle<T> | chunkComponentTypeHandle | An object containing type and job safety information. Create this object by calling GetSharedComponentTypeHandle<T>() immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
Returns
Type | Description |
---|---|
Boolean | True, if this chunk contains a shared component of the specified type. |
Type Parameters
Name | Description |
---|---|
T | The data type of the shared component. |
Remarks
When an EntityQuery includes optional components used as shared components (with Any), some chunks returned by the query may have these shared components and some may not. Use this function to determine whether or not the current chunk contains one of these optional component types as a shared component.
HasChunkComponent<T>(ComponentTypeHandle<T>)
Reports whether this chunk contains a chunk component of the specified component type.
Declaration
public bool HasChunkComponent<T>(ComponentTypeHandle<T> chunkComponentTypeHandle)
where T : struct, IComponentData
Parameters
Type | Name | Description |
---|---|---|
ComponentTypeHandle<T> | chunkComponentTypeHandle | An object containing type and job safety information. Create this object by calling GetComponentTypeHandle<T>(Boolean) immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
Returns
Type | Description |
---|---|
Boolean | True, if this chunk contains a chunk component of the specified type. |
Type Parameters
Name | Description |
---|---|
T | The data type of the chunk component. |
Remarks
When an EntityQuery includes optional components used as chunk components (with Any), some chunks returned by the query may have these chunk components and some may not. Use this function to determine whether or not the current chunk contains one of these optional component types as a chunk component.
Invalid()
Reports whether this ArchetypeChunk instance is invalid.
Declaration
public bool Invalid()
Returns
Type | Description |
---|---|
Boolean | True, if no Archetype is associated with the this ArchetypeChunk instance. |
NumSharedComponents()
The number of shared components in the archetype associated with this chunk.
Declaration
public int NumSharedComponents()
Returns
Type | Description |
---|---|
Int32 | The shared component count. |
SetChunkComponentData<T>(ComponentTypeHandle<T>, T)
Sets the value of a chunk component.
Declaration
public void SetChunkComponentData<T>(ComponentTypeHandle<T> chunkComponentTypeHandle, T value)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
ComponentTypeHandle<T> | chunkComponentTypeHandle | An object containing type and job safety information. Create this object by calling GetComponentTypeHandle<T>(Boolean) immediately before scheduling a job. Pass the object to a job using a public field you define as part of the job struct. |
T | value | A struct of type T containing the new values for the chunk component. |
Type Parameters
Name | Description |
---|---|
T | The data type of the chunk component. |
Operators
Equality(ArchetypeChunk, ArchetypeChunk)
Two ArchetypeChunk instances are equal if they reference the same block of chunk and entity component store memory.
Declaration
public static bool operator ==(ArchetypeChunk lhs, ArchetypeChunk rhs)
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunk | lhs | An ArchetypeChunk |
ArchetypeChunk | rhs | Another ArchetypeChunk |
Returns
Type | Description |
---|---|
Boolean | True, if both ArchetypeChunk instances reference the same memory, or both contain null memory references. |
Inequality(ArchetypeChunk, ArchetypeChunk)
Two ArchetypeChunk instances are only equal if they reference the same block of chunk and entity component store memory.
Declaration
public static bool operator !=(ArchetypeChunk lhs, ArchetypeChunk rhs)
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunk | lhs | An ArchetypeChunk |
ArchetypeChunk | rhs | Another ArchetypeChunk |
Returns
Type | Description |
---|---|
Boolean | True, if the ArchetypeChunk instances reference different blocks of memory. |