Documentation

Unity Engine

Download Unity

Unity Engine

GetSharedComponentPtrRO(Entity, ComponentType)

Gets a read-only pointer to the value of a shared component of an entity.
Read time 1 minuteLast updated 2 days ago

Definition

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

Parameters

entity

The entity.

Returns

Type

Description

void*A pointer to the value, which must not be written to.

Remarks

The value is TypeManager.TypeInfo.TypeSize bytes long, and is shared by every entity with the same value in the entity's world. The pointer is invalid after the next structural change in that world.