GetChunkComponentDataPtrRO(Entity, ComponentType)
Gets a read-only pointer to a chunk component of the chunk that holds an entity.
Read time 1 minuteLast updated 3 days ago
Definition
- Type: Method
- Namespace: Unity.Entities
- Assembly: UnityEngine.EntitiesModule
public static void* GetChunkComponentDataPtrRO(Entity entity, ComponentType type)
Parameters
The entity.
A chunk component type, such as ComponentType.ChunkComponent returns, of an unmanaged IComponentData type that isn't zero-sized.
Returns
Type | Description |
|---|---|
| void* | A pointer to the component's data, which must not be written to. |
Remarks
The value lives on the chunk's meta entity, and is shared by every entity in the chunk. The data is TypeManager.TypeInfo.SizeInChunk bytes of the component's type. The pointer is invalid after the next structural change in the entity's world.