docs.unity3d.com
    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
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023