Documentation

Unity Engine


Unity Engine


GetComponentLookup<T>(bool)

Manually gets a dictionary-like container containing all components of type T, keyed by Entity.
Read time 1 minuteLast updated a day ago

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule
public ComponentLookup<T> GetComponentLookup<T>(bool isReadOnly = false) where T : unmanaged, IComponentData

Parameters

isReadOnly

Whether the data is only read, not written. Access data as read-only whenever possible.

Returns

Type

Description

ComponentLookup<T>All component data of type T.

Remarks

Remember to call ComponentLookup<T>.Update.
Prefer using SystemAPI.GetComponentLookup as it will cache in OnCreate for you and call .Update(ref state) at the call-site.