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

SystemState.GetComponentTypeHandle

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 ComponentTypeHandle<T> GetComponentTypeHandle(bool isReadOnly);

Parameters

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

Returns

ComponentTypeHandle<T> An object representing the type information required to safely access component data stored in a chunk.

Description

Manually gets the run-time type information required to access an array of component data in a chunk.

Remember to call ComponentTypeHandle<T0>.Update.

Pass an ComponentTypeHandle<T0> instance to a job that has access to chunk data, such as an IJobChunk job, to access that type of component inside the job.

Prefer using SystemAPI.GetComponentTypeHandle in SystemAPI as it will cache in OnCreate for you and call .Update(ref SystemState) at the call-site.