# ArchetypeChunk

> A block of unmanaged memory containing the components for entities sharing the same ArchetypeChunk.Archetype.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule
* **Implements:** [IEquatable\<ArchetypeChunk>](https://learn.microsoft.com/dotnet/api/system.iequatable-1)

```csharp
public struct ArchetypeChunk : IEquatable<ArchetypeChunk>
```

## Properties

| Property                                                                                          | Description                                                          |
| ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| [Archetype](/engine/7000.0/script-reference/unity/entities/archetypechunk/archetype.md)           | The archetype of the entities stored in this chunk.                  |
| [Capacity](/engine/7000.0/script-reference/unity/entities/archetypechunk/capacity.md)             | The number of entities that can fit in this chunk.                   |
| [Count](/engine/7000.0/script-reference/unity/entities/archetypechunk/count.md)                   | Returns the number of entities in the chunk.                         |
| [Full](/engine/7000.0/script-reference/unity/entities/archetypechunk/full.md)                     | Whether this chunk is exactly full.                                  |
| [SequenceNumber](/engine/7000.0/script-reference/unity/entities/archetypechunk/sequencenumber.md) | SequenceNumber is a unique number for each chunk, across all worlds. |

## Static Properties

| Property                                                                      | Description                                                                                          |
| ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| [Null](/engine/7000.0/script-reference/unity/entities/archetypechunk/null.md) | A special "null" ArchetypeChunk that you can use to test whether ArchetypeChunk instances are valid. |

## Methods

| Method                                                                                                                                              | Description                                                                                                                                                                                                                                                                                                                                                                                                           |
| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [DidChange](/engine/7000.0/script-reference/unity/entities/archetypechunk/didchange.md)                                                             | Reports whether the data in any of IComponentData components in the chunk, of the type identified by `typeHandle`, could have changed since the specified version.                                                                                                                                                                                                                                                    |
| [DidOrderChange](/engine/7000.0/script-reference/unity/entities/archetypechunk/didorderchange.md)                                                   | Reports whether a structural change has occured in this chunk since the specified version.                                                                                                                                                                                                                                                                                                                            |
| [Equals](/engine/7000.0/script-reference/unity/entities/archetypechunk/equals.md)                                                                   | Two ArchetypeChunk instances are equal if they reference the same block of chunk memory.                                                                                                                                                                                                                                                                                                                              |
| [GetBufferAccessor](/engine/7000.0/script-reference/unity/entities/archetypechunk/getbufferaccessor.md)                                             | Provides access to a chunk's array of component values for a specific buffer component type.                                                                                                                                                                                                                                                                                                                          |
| [GetBufferAccessorRO](/engine/7000.0/script-reference/unity/entities/archetypechunk/getbufferaccessorro.md)                                         | Provides read-only access to a chunk's array of component values for a specific buffer component type.                                                                                                                                                                                                                                                                                                                |
| [GetBufferAccessorRW](/engine/7000.0/script-reference/unity/entities/archetypechunk/getbufferaccessorrw.md)                                         | Provides read/write access to a chunk's array of component values for a specific buffer component type.                                                                                                                                                                                                                                                                                                               |
| [GetChangeVersion](/engine/7000.0/script-reference/unity/entities/archetypechunk/getchangeversion.md)                                               | Gets the change version number assigned to the specified type of component in this chunk.                                                                                                                                                                                                                                                                                                                             |
| [GetChunkComponentData](/engine/7000.0/script-reference/unity/entities/archetypechunk/getchunkcomponentdata.md)                                     | Gets the value of a chunk component.                                                                                                                                                                                                                                                                                                                                                                                  |
| [GetChunkComponentDataRW](/engine/7000.0/script-reference/unity/entities/archetypechunk/getchunkcomponentdatarw.md)                                 | Gets a reference to the value of a chunk component for read-write access.                                                                                                                                                                                                                                                                                                                                             |
| [GetComponentDataPtrRO](/engine/7000.0/script-reference/unity/entities/archetypechunk/getcomponentdataptrro.md)                                     | Provides an unsafe read-only interface to components stored in this chunk.                                                                                                                                                                                                                                                                                                                                            |
| [GetComponentDataPtrRW](/engine/7000.0/script-reference/unity/entities/archetypechunk/getcomponentdataptrrw.md)                                     | Provides an unsafe read/write interface to components stored in this chunk.                                                                                                                                                                                                                                                                                                                                           |
| [GetDynamicComponentDataArrayReinterpret](/engine/7000.0/script-reference/unity/entities/archetypechunk/getdynamiccomponentdataarrayreinterpret.md) | Construct a NativeArray view of a chunk's component data.                                                                                                                                                                                                                                                                                                                                                             |
| [GetDynamicSharedComponentDataAddress](/engine/7000.0/script-reference/unity/entities/archetypechunk/getdynamicsharedcomponentdataaddress.md)       | Provides an unsafe interface to shared components stored in this chunk.                                                                                                                                                                                                                                                                                                                                               |
| [GetEnableableBits](/engine/7000.0/script-reference/unity/entities/archetypechunk/getenableablebits.md)                                             | Gets a copy of all the Enableable bits for the specified type handle.                                                                                                                                                                                                                                                                                                                                                 |
| [GetEnabledMask](/engine/7000.0/script-reference/unity/entities/archetypechunk/getenabledmask.md)                                                   | Provides a [EnabledMask](/engine/7000.0/script-reference/unity/entities/enabledmask.md) to the component enabled bits in this chunk.                                                                                                                                                                                                                                                                                  |
| [GetEntityDataPtrRO](/engine/7000.0/script-reference/unity/entities/archetypechunk/getentitydataptrro.md)                                           | Provides an unsafe read-only interface to array of Entities stored in this chunk.                                                                                                                                                                                                                                                                                                                                     |
| [GetHashCode](/engine/7000.0/script-reference/unity/entities/archetypechunk/gethashcode.md)                                                         | Computes a hashcode to support hash-based collections.                                                                                                                                                                                                                                                                                                                                                                |
| [GetNativeArray](/engine/7000.0/script-reference/unity/entities/archetypechunk/getnativearray.md)                                                   | Provides a native array interface to entity instances stored in this chunk.                                                                                                                                                                                                                                                                                                                                           |
| [GetOrderVersion](/engine/7000.0/script-reference/unity/entities/archetypechunk/getorderversion.md)                                                 | Gets the order version number assigned to this chunk.                                                                                                                                                                                                                                                                                                                                                                 |
| [GetRequiredComponentDataPtrRO](/engine/7000.0/script-reference/unity/entities/archetypechunk/getrequiredcomponentdataptrro.md)                     | Provides 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](/engine/7000.0/script-reference/unity/entities/archetypechunk/getcomponentdataptrro.md) in cases where the caller can't guarantee this.                                                                                        |
| [GetRequiredComponentDataPtrRW](/engine/7000.0/script-reference/unity/entities/archetypechunk/getrequiredcomponentdataptrrw.md)                     | Provides 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](/engine/7000.0/script-reference/unity/entities/archetypechunk/getcomponentdataptrrw.md) in cases where the caller can't guarantee this.                                                                                       |
| [GetSharedComponent](/engine/7000.0/script-reference/unity/entities/archetypechunk/getsharedcomponent.md)                                           | Gets the current value of an unmanaged shared component.                                                                                                                                                                                                                                                                                                                                                              |
| [GetSharedComponentDataBoxed](/engine/7000.0/script-reference/unity/entities/archetypechunk/getsharedcomponentdataboxed.md)                         | Gets the current value of a shared component.                                                                                                                                                                                                                                                                                                                                                                         |
| [GetSharedComponentIndex](/engine/7000.0/script-reference/unity/entities/archetypechunk/getsharedcomponentindex.md)                                 | Gets the index into the array of unique values for the specified shared component.                                                                                                                                                                                                                                                                                                                                    |
| [GetTransformAccessor](/engine/7000.0/script-reference/unity/entities/archetypechunk/gettransformaccessor.md)                                       | Gets an accessor for the transforms of the entities in this chunk.                                                                                                                                                                                                                                                                                                                                                    |
| [GetUntypedBufferAccessor](/engine/7000.0/script-reference/unity/entities/archetypechunk/getuntypedbufferaccessor.md)                               | Give unsafe access to the buffers with type `chunkBufferTypeHandle` in the chunk.                                                                                                                                                                                                                                                                                                                                     |
| [GetUntypedBufferAccessorReinterpret](/engine/7000.0/script-reference/unity/entities/archetypechunk/getuntypedbufferaccessorreinterpret.md)         | Construct a typed BufferAccessor view of a chunk's buffer component data from an untyped component handle.                                                                                                                                                                                                                                                                                                            |
| [Has](/engine/7000.0/script-reference/unity/entities/archetypechunk/has.md)                                                                         | Reports whether this chunk contains the specified component type.                                                                                                                                                                                                                                                                                                                                                     |
| [HasChunkComponent](/engine/7000.0/script-reference/unity/entities/archetypechunk/haschunkcomponent.md)                                             | Reports whether this chunk contains a chunk component of the specified component type.                                                                                                                                                                                                                                                                                                                                |
| [Invalid](/engine/7000.0/script-reference/unity/entities/archetypechunk/invalid.md)                                                                 | Reports whether this ArchetypeChunk instance is invalid.                                                                                                                                                                                                                                                                                                                                                              |
| [IsComponentEnabled](/engine/7000.0/script-reference/unity/entities/archetypechunk/iscomponentenabled.md)                                           | Checks whether a given [IBufferElementData](/engine/7000.0/script-reference/unity/entities/ibufferelementdata.md) is enabled on the specified [Entity](/engine/7000.0/script-reference/unity/entities/entity.md). For the purposes of EntityQuery matching, an entity with a disabled component will behave as if it does not have that component.                                                                    |
| [NumSharedComponents](/engine/7000.0/script-reference/unity/entities/archetypechunk/numsharedcomponents.md)                                         | The number of shared components in the archetype associated with this chunk.                                                                                                                                                                                                                                                                                                                                          |
| [SetChunkComponentData](/engine/7000.0/script-reference/unity/entities/archetypechunk/setchunkcomponentdata.md)                                     | Sets the value of a chunk component.                                                                                                                                                                                                                                                                                                                                                                                  |
| [SetComponentEnabled](/engine/7000.0/script-reference/unity/entities/archetypechunk/setcomponentenabled.md)                                         | Enable or disable a [IComponentData](/engine/7000.0/script-reference/unity/entities/icomponentdata.md) on the specified [Entity](/engine/7000.0/script-reference/unity/entities/entity.md). 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. |
| [SetComponentEnabledForAll](/engine/7000.0/script-reference/unity/entities/archetypechunk/setcomponentenabledforall.md)                             | Enable or disable a component on all entities in this chunk.                                                                                                                                                                                                                                                                                                                                                          |

## Operators

| Operator                                                                                      | Description                                                                                                              |
| --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| [operator ==](/engine/7000.0/script-reference/unity/entities/archetypechunk/op-equality.md)   | Two ArchetypeChunk instances are equal if they reference the same block of chunk and entity component store memory.      |
| [operator !=](/engine/7000.0/script-reference/unity/entities/archetypechunk/op-inequality.md) | Two ArchetypeChunk instances are only equal if they reference the same block of chunk and entity component store memory. |
