docs.unity.cn
    Show / Hide Table of Contents

    Method SetComponentEnabled

    SetComponentEnabled<T>(Entity, Boolean)

    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

    Boolean 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>(Boolean)

    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
    Boolean 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.

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023