docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method SetComponentEnabled

    SetComponentEnabled<T>(Entity, bool)

    Sets the enabled value of the component on the Entity.

    Declaration
    public void SetComponentEnabled<T>(Entity entity, bool enabled) where T : struct, IEnableableComponent
    Parameters
    Type Name Description
    Entity entity

    The Entity to set the component to

    bool enabled

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

    Type Parameters
    Name Description
    T

    The type of component to set

    Remarks

    This method can only be invoked if the same baker instance previously added this specific component.

    SetComponentEnabled<T>(bool)

    Sets the enabled value of the component on the primary Entity.

    Declaration
    [Obsolete("Use the version of the function with the explicit Entity parameter (RemovedAfter Entities 1.0)")]
    public void SetComponentEnabled<T>(bool enabled) where T : struct, IEnableableComponent
    Parameters
    Type Name Description
    bool enabled

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

    Type Parameters
    Name Description
    T

    The type of component to set

    Remarks

    Implicitly it will access the primary entity with TransformUsageFlags.Dynamic.

    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)