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

EntityCommandBuffer.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 e, bool value);

Parameters

Parameter Description
e The entity whose component should be enabled or disabled.
value True if the specified component should be enabled, or false if it should be disabled.

Description

Records a command to add or remove the Disabled component. By default EntityQuery does not include entities containing the Disabled component. Enabled entities are processed by systems, disabled entities are not.

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

At playback, this command throws an error if this entity is destroyed before playback, if the entity has the Prefab tag.