Documentation

Unity Engine

Download Unity

Unity Engine

GetComponentData<T>()

Gets the value of the ComponentData T, an IComponentData, on this GameObject.
Read time 1 minuteLast updated 6 hours ago

Definition

public T GetComponentData<T>() where T : unmanaged, IComponentData

Returns

Type

Description

TA copy of the value.

Remarks

Throws an
ArgumentException
if the GameObject has been destroyed or doesn't have the ComponentData.
Waits for the jobs that write
T
to complete. To avoid the wait, read
T
in a job through a
Unity.Entities.ComponentLookup
. The job then runs after the jobs that write
T
, instead of the main thread waiting for them.