docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method SetComponentEnabled

    SetComponentEnabled(Entity, bool)

    Obsolete. Use SetBufferEnabled(Entity, bool) instead.

    Declaration
    [Obsolete("Use SetBufferEnabled (RemovedAfter: Entities pre-1.0) (UnityUpgradeable) -> SetBufferEnabled(*)")]
    public void SetComponentEnabled(Entity entity, bool value)
    Parameters
    Type Name Description
    Entity entity

    The entity whose component should be enabled or disabled.

    bool value

    True if the specified component should be enabled, or false if it should be disabled.

    Remarks

    Obsolete. Use SetBufferEnabled(Entity, bool) instead.

     Enable or disable the <xref href="Unity.Entities.IBufferElementData" data-throw-if-not-resolved="false"></xref> of type T on the specified <xref href="Unity.Entities.Entity" data-throw-if-not-resolved="false"></xref>. This operation
     does not cause a structural change (even if it occurs on a worker thread), or affect the value of the component.
     For the purposes of EntityQuery matching, an entity with a disabled component will behave as if it does not
     have that component. The type T must implement the <xref href="Unity.Entities.IEnableableComponent" data-throw-if-not-resolved="false"></xref> interface.
    
    Exceptions
    Type Condition
    ArgumentException

    The Entity does not exist.

    See Also
    IsBufferEnabled(Entity)
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)