Documentation

Unity Engine

Download Unity

Unity Engine

GetChunkComponentDataPtrRW(Entity, ComponentType)

Gets a read/write pointer to a chunk component of the chunk that holds an entity.
Read time 1 minuteLast updated 2 days ago

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule
public static void* GetChunkComponentDataPtrRW(Entity entity, ComponentType type)

Parameters

entity

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.

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. Getting it bumps the component's change version in the meta entity's chunk.