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

EntityManager.SetEnabled

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 void SetEnabled(Entity entity, bool enabled);

Parameters

Parameter Description
entity The entity to enable or disable
enabled True if the entity should be enabled

Description

Adds or removes the Disabled component to an Entity.

Entities with the Disabled component are not matched by any EntityQuery, and are therefore not processed by systems. To override this behavior for a specific query, use EntityQueryOptions.IncludeDisabledEntities at query creation time.

If the entity was converted from a prefab and thus has a LinkedEntityGroup component, the entire group will be enabled or disabled.

This operation requires a structural change to add or remove the Disabled component. To enable or disable individual components without requiring a structural change, see IEnableableComponent and EntityManager.SetComponentEnabled.

Additional resources: EntityManager.IsEnabled