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

EntityManager.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 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 a given ComponentType is enabled on the specified Entity.

An entity with a disabled component will not match an EntityQuery that requires that component, and will match a query that excludes that component.

Additional resources: EntityManager.SetComponentEnabled, ComponentLookup<T0>.IsComponentEnabled


Declaration

public 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 a given ComponentType is enabled on the specified system using SystemHandle.


Declaration

public bool IsComponentEnabled(Entity entity, ComponentType componentType);

Parameters

Parameter Description
entity The entity whose component should be checked.
componentType The component type to enable or disable. This type must implement the IEnableableComponent interface.

Returns

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

Description

Checks whether a given ComponentType is enabled on the specified Entity.

An entity with a disabled component will not match an EntityQuery that requires that component, and will match a query that excludes that component.

Additional resources: EntityManager.SetComponentEnabled, ComponentLookup<T0>.IsComponentEnabled