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

SystemAPI.IsComponentEnabled

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 static bool IsComponentEnabled(Entity entity);

Parameters

Parameter Description
entity The entity whose component should be checked.

Returns

bool True if the specified component is enabled, or false if it is disabled.

Description

Checks whether the IComponentData of type T is enabled on the specified Entity. For the purposes of EntityQuery matching, an entity with a disabled component will behave as if it does not have that component. The type T must implement the IEnableableComponent interface.

Not working in Entities.ForEach, IJobEntity, and Utility methods

Additional resources: SystemAPI.SetComponentEnabled


Declaration

public static bool IsComponentEnabled(SystemHandle systemHandle);

Parameters

Parameter Description
systemHandle The system whose component should be checked.

Returns

bool True if the specified component is enabled, or false if it is disabled.

Description

Checks whether the IComponentData of type T is enabled on the specified system using a SystemHandle. For the purposes of EntityQuery matching, a system with a disabled component will behave as if it does not have that component. The type T must implement the IEnableableComponent interface.

Not working in Entities.ForEach, IJobEntity, and Utility methods

Additional resources: SystemAPI.SetComponentEnabled