文档

Unity Engine

Download Unity

Unity Engine

GetComponentLookup<T>(bool)

Manually gets a dictionary-like container containing all components of type T, keyed by Entity.
阅读时间1 分钟最后更新于 5 天前

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 GetComponentLookup{T} as it will cache in OnCreate for you and call .Update(ref state) at the call-site.