Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

SystemBase.GetComponentLookup

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public ComponentLookup<T> GetComponentLookup(bool isReadOnly);

Parameters

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

Returns

ComponentLookup<T> All component data of type T.

Description

Manually gets a dictionary-like container containing all components of type T, keyed by Entity.

Remember to call ComponentLookup<T0>.Update.

When you call this method on the main thread, it invokes ComponentSystemBase.GetComponentLookup.

Prefer using SystemAPI.GetComponentLookup as it will cache in OnCreate for you and call .Update(this) at the call-site. Also works with IJobEntity and SystemAPI.Query.