Documentation

Unity Engine


Unity Engine


ArchetypeChunk

A block of unmanaged memory containing the components for entities sharing the same ArchetypeChunk.Archetype.
Read time 4 minutesLast updated a day ago

Definition

public struct ArchetypeChunk : IEquatable<ArchetypeChunk>

Properties

Property

Description

ArchetypeThe archetype of the entities stored in this chunk.
CapacityThe number of entities that can fit in this chunk.
CountReturns the number of entities in the chunk.
FullWhether this chunk is exactly full.
SequenceNumberSequenceNumber is a unique number for each chunk, across all worlds.

Static Properties

Property

Description

NullA special "null" ArchetypeChunk that you can use to test whether ArchetypeChunk instances are valid.

Methods

Method

Description

DidChangeReports whether the data in any of IComponentData components in the chunk, of the type identified by
typeHandle
, could have changed since the specified version.
DidOrderChangeReports whether a structural change has occured in this chunk since the specified version.
EqualsTwo ArchetypeChunk instances are equal if they reference the same block of chunk memory.
GetBufferAccessorProvides access to a chunk's array of component values for a specific buffer component type.
GetBufferAccessorROProvides read-only access to a chunk's array of component values for a specific buffer component type.
GetBufferAccessorRWProvides read/write access to a chunk's array of component values for a specific buffer component type.
GetChangeVersionGets the change version number assigned to the specified type of component in this chunk.
GetChunkComponentDataGets the value of a chunk component.
GetChunkComponentDataRWGets a reference to the value of a chunk component for read-write access.
GetComponentDataPtrROProvides an unsafe read-only interface to components stored in this chunk.
GetComponentDataPtrRWProvides an unsafe read/write interface to components stored in this chunk.
GetDynamicComponentDataArrayReinterpretConstruct a NativeArray view of a chunk's component data.
GetDynamicSharedComponentDataAddressProvides an unsafe interface to shared components stored in this chunk.
GetEnableableBitsGets a copy of all the Enableable bits for the specified type handle.
GetEnabledMaskProvides a EnabledMask to the component enabled bits in this chunk.
GetEntityDataPtrROProvides an unsafe read-only interface to array of Entities stored in this chunk.
GetHashCodeComputes a hashcode to support hash-based collections.
GetNativeArrayProvides a native array interface to entity instances stored in this chunk.
GetOrderVersionGets the order version number assigned to this chunk.
GetRequiredComponentDataPtrROProvides an unsafe read-only interface to components stored in this chunk. This variant assumes that the component is present in the chunk; use ArchetypeChunk.GetComponentDataPtrRO in cases where the caller can't guarantee this.
GetRequiredComponentDataPtrRWProvides an unsafe read/write interface to components stored in this chunk. This variant assumes that the component is present in the chunk; use ArchetypeChunk.GetComponentDataPtrRW in cases where the caller can't guarantee this.
GetSharedComponentGets the current value of an unmanaged shared component.
GetSharedComponentDataBoxedGets the current value of a shared component.
GetSharedComponentIndexGets the index into the array of unique values for the specified shared component.
GetTransformAccessorGets an accessor for the transforms of the entities in this chunk.
GetUntypedBufferAccessorGive unsafe access to the buffers with type
chunkBufferTypeHandle
in the chunk.
GetUntypedBufferAccessorReinterpretConstruct a typed BufferAccessor view of a chunk's buffer component data from an untyped component handle.
HasReports whether this chunk contains the specified component type.
HasChunkComponentReports whether this chunk contains a chunk component of the specified component type.
InvalidReports whether this ArchetypeChunk instance is invalid.
IsComponentEnabledChecks whether a given IBufferElementData is enabled on the specified Entity. For the purposes of EntityQuery matching, an entity with a disabled component will behave as if it does not have that component.
NumSharedComponentsThe number of shared components in the archetype associated with this chunk.
SetChunkComponentDataSets the value of a chunk component.
SetComponentEnabledEnable or disable a IComponentData on the specified Entity. This operation does not cause a structural change, or affect the value of the component. For the purposes of EntityQuery matching, an entity with a disabled component will behave as if it does not have that component.
SetComponentEnabledForAllEnable or disable a component on all entities in this chunk.

Operators

Operator

Description

operator ==Two ArchetypeChunk instances are equal if they reference the same block of chunk and entity component store memory.
operator !=Two ArchetypeChunk instances are only equal if they reference the same block of chunk and entity component store memory.