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.
BatchEntityCount
If the ArchetypeChunk is sub-batched, returns the number of entities referenced by this batch.
Declaration
public int BatchEntityCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
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.
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(ArchetypeChunkComponentTypeDynamic, 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(ArchetypeChunkComponentTypeDynamic chunkComponentType, uint version)
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkComponentTypeDynamic | chunkComponentType | An object containing type and job safety information. Create this object by calling GetArchetypeChunkComponentTypeDynamic(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>(ArchetypeChunkBufferType<T>, UInt32)
Reports whether any of the data in dynamic buffer components in the chunk, of the type identified by
chunkBufferType
, could have changed since the specified version.
Declaration
public bool DidChange<T>(ArchetypeChunkBufferType<T> chunkBufferType, uint version)
where T : struct, IBufferElementData
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkBufferType<T> | chunkBufferType | An object containing type and job safety information. Create this object by calling GetArchetypeChunkBufferType<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>(ArchetypeChunkComponentType<T>, 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<T>(ArchetypeChunkComponentType<T> chunkComponentType, uint version)
where T : IComponentData
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkComponentType<T> | chunkComponentType | An object containing type and job safety information. Create this object by calling GetArchetypeChunkComponentType<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>(ArchetypeChunkSharedComponentType<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>(ArchetypeChunkSharedComponentType<T> chunkSharedComponentData, uint version)
where T : struct, ISharedComponentData
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkSharedComponentType<T> | chunkSharedComponentData | An object containing type and job safety information. Create this object by calling GetArchetypeChunkSharedComponentType<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>(ArchetypeChunkBufferType<T>)
Declaration
public BufferAccessor<T> GetBufferAccessor<T>(ArchetypeChunkBufferType<T> bufferComponentType)
where T : struct, IBufferElementData
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkBufferType<T> | bufferComponentType |
Returns
Type | Description |
---|---|
BufferAccessor<T> |
Type Parameters
Name | Description |
---|---|
T |
GetChangeVersion(ArchetypeChunkComponentTypeDynamic)
Gets the change version number assigned to the specified type of component in this chunk.
Declaration
public uint GetChangeVersion(ArchetypeChunkComponentTypeDynamic chunkComponentType)
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkComponentTypeDynamic | chunkComponentType | An object containing type and job safety information. Create this object by calling GetArchetypeChunkComponentTypeDynamic(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>(ArchetypeChunkComponentType<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>(ArchetypeChunkBufferType<T>)
Gets the change version number assigned to the specified type of dynamic buffer component in this chunk.
Declaration
public uint GetChangeVersion<T>(ArchetypeChunkBufferType<T> chunkBufferType)
where T : struct, IBufferElementData
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkBufferType<T> | chunkBufferType | An object containing type and job safety information. Create this object by calling GetArchetypeChunkBufferType<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>(ArchetypeChunkComponentType<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>(ArchetypeChunkComponentType<T>)
Gets the change version number assigned to the specified type of component in this chunk.
Declaration
public uint GetChangeVersion<T>(ArchetypeChunkComponentType<T> chunkComponentType)
where T : IComponentData
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkComponentType<T> | chunkComponentType | An object containing type and job safety information. Create this object by calling GetArchetypeChunkComponentType<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>(ArchetypeChunkComponentType<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>(ArchetypeChunkSharedComponentType<T>)
Gets the change version number assigned to the specified type of shared component in this chunk.
Declaration
public uint GetChangeVersion<T>(ArchetypeChunkSharedComponentType<T> chunkSharedComponentData)
where T : struct, ISharedComponentData
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkSharedComponentType<T> | chunkSharedComponentData | An object containing type and job safety information. Create this object by calling GetArchetypeChunkSharedComponentType<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>(ArchetypeChunkComponentType<T>)
Gets the value of a chunk component.
Declaration
public T GetChunkComponentData<T>(ArchetypeChunkComponentType<T> chunkComponentType)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkComponentType<T> | chunkComponentType | An object containing type and job safety information. Create this object by calling GetArchetypeChunkComponentType<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. |
GetComponentObjects<T>(ArchetypeChunkComponentType<T>, EntityManager)
Declaration
public ArchetypeChunkComponentObjects<T> GetComponentObjects<T>(ArchetypeChunkComponentType<T> componentType, EntityManager manager)
where T : class
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkComponentType<T> | componentType | |
EntityManager | manager |
Returns
Type | Description |
---|---|
ArchetypeChunkComponentObjects<T> |
Type Parameters
Name | Description |
---|---|
T |
GetDynamicComponentDataArrayReinterpret<T>(ArchetypeChunkComponentTypeDynamic, Int32)
Declaration
public NativeArray<T> GetDynamicComponentDataArrayReinterpret<T>(ArchetypeChunkComponentTypeDynamic chunkComponentType, int expectedTypeSize)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkComponentTypeDynamic | 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
GetNativeArray(ArchetypeChunkEntityType)
Provides a native array interface to entity instances stored in this chunk.
Declaration
public NativeArray<Entity> GetNativeArray(ArchetypeChunkEntityType archetypeChunkEntityType)
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkEntityType | archetypeChunkEntityType | An object containing type and job safety information. Create this object by calling GetArchetypeChunkEntityType() 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>(ArchetypeChunkComponentType<T>)
Provides a native array interface to components stored in this chunk.
Declaration
public NativeArray<T> GetNativeArray<T>(ArchetypeChunkComponentType<T> chunkComponentType)
where T : struct, IComponentData
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkComponentType<T> | chunkComponentType | An object containing type and job safety information. Create this
object by calling |
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>(ArchetypeChunkSharedComponentType<T>, EntityManager)
Gets the current value of a shared component.
Declaration
public T GetSharedComponentData<T>(ArchetypeChunkSharedComponentType<T> chunkSharedComponentData, EntityManager entityManager)
where T : struct, ISharedComponentData
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkSharedComponentType<T> | chunkSharedComponentData | An object containing type and job safety information. Create this object by calling GetArchetypeChunkSharedComponentType<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>(ArchetypeChunkSharedComponentType<T>)
Gets the index into the array of unique values for the specified shared component.
Declaration
public int GetSharedComponentIndex<T>(ArchetypeChunkSharedComponentType<T> chunkSharedComponentData)
where T : struct, ISharedComponentData
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkSharedComponentType<T> | chunkSharedComponentData | An object containing type and job safety information. Create this object by calling GetArchetypeChunkSharedComponentType<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(ArchetypeChunkComponentTypeDynamic)
Declaration
public bool Has(ArchetypeChunkComponentTypeDynamic chunkComponentType)
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkComponentTypeDynamic | chunkComponentType |
Returns
Type | Description |
---|---|
Boolean |
Has<T>(ArchetypeChunkBufferType<T>)
Reports whether this chunk contains a dynamic buffer containing the specified component type.
Declaration
public bool Has<T>(ArchetypeChunkBufferType<T> chunkBufferType)
where T : struct, IBufferElementData
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkBufferType<T> | chunkBufferType | An object containing type and job safety information. Create this object by calling GetArchetypeChunkBufferType<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>(ArchetypeChunkComponentType<T>)
Reports whether this chunk contains the specified component type.
Declaration
public bool Has<T>(ArchetypeChunkComponentType<T> chunkComponentType)
where T : IComponentData
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkComponentType<T> | chunkComponentType | An object containing type and job safety information. Create this object by calling GetArchetypeChunkComponentType<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>(ArchetypeChunkSharedComponentType<T>)
Reports whether this chunk contains a shared component of the specified component type.
Declaration
public bool Has<T>(ArchetypeChunkSharedComponentType<T> chunkComponentType)
where T : struct, ISharedComponentData
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkSharedComponentType<T> | chunkComponentType | An object containing type and job safety information. Create this object by calling GetArchetypeChunkSharedComponentType<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>(ArchetypeChunkComponentType<T>)
Reports whether this chunk contains a chunk component of the specified component type.
Declaration
public bool HasChunkComponent<T>(ArchetypeChunkComponentType<T> chunkComponentType)
where T : struct, IComponentData
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkComponentType<T> | chunkComponentType | An object containing type and job safety information. Create this object by calling GetArchetypeChunkComponentType<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>(ArchetypeChunkComponentType<T>, T)
Sets the value of a chunk component.
Declaration
public void SetChunkComponentData<T>(ArchetypeChunkComponentType<T> chunkComponentType, T value)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
ArchetypeChunkComponentType<T> | chunkComponentType | An object containing type and job safety information. Create this object by calling GetArchetypeChunkComponentType<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. |