Documentation

Unity Engine

Download Unity

Unity Engine

IsComponentEnabled<T>()

Checks whether the enableable data component T, an IEnableableComponent, on the GameObject this Component is attached to is enabled.
Read time 1 minuteLast updated 6 hours ago

Definition

public bool IsComponentEnabled<T>() where T : unmanaged, IEnableableComponent

Returns

Type

Description

boolTrue if the data component is enabled.

Remarks

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