docs.unity.cn
    Show / Hide Table of Contents

    Method SetEnabled

    SetEnabled(Entity, Boolean)

    Enabled entities are processed by systems, disabled entities are not. Adds or removes the Disabled component. By default EntityQuery does not include entities containing the Disabled component.

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

    Declaration
    public void SetEnabled(Entity entity, bool enabled)
    Parameters
    Type Name Description
    Entity entity

    The entity to enable or disable

    Boolean enabled

    True if the entity should be enabled

    Exceptions
    Type Condition
    ArgumentException

    The Entity does not exist.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Wednesday, July 6, 2022
    Terms of use