docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method RemoveComponent

    RemoveComponent(ForEachLambdaJobDescription, ComponentType)

    Removes a component from a set of entities selected by the query you have defined using WithAny/WithAll/WithNone

    Declaration
    public static void RemoveComponent(this ForEachLambdaJobDescription description, ComponentType componentType)
    Parameters
    Type Name Description
    ForEachLambdaJobDescription description

    The target object

    ComponentType componentType

    The type of component to remove.

    Remarks

    Can remove any kind of component.

    It's OK if some or all of the components to remove are already missing from some or all of the entities.

    Removing a component changes an entity's archetype and results in the entity being moved to a different chunk.

    Important: This function creates a sync point, which means that the EntityManager waits for all currently running Jobs to complete before removing the component and no additional Jobs can start before the function is finished. A sync point can cause a drop in performance because the ECS framework may not be able to make use of the processing power of all available cores.

    RemoveComponent(ForEachLambdaJobDescription, in ComponentTypeSet)

    Removes a set of components from a set of entities selected by the query you have defined using WithAny/WithAll/WithNone

    Declaration
    public static void RemoveComponent(this ForEachLambdaJobDescription description, in ComponentTypeSet componentTypes)
    Parameters
    Type Name Description
    ForEachLambdaJobDescription description

    The target object

    ComponentTypeSet componentTypes

    The types of components to add.

    Remarks

    Can remove any kinds of components.

    It's OK if some or all of the components to remove are already missing from some or all of the entities.

    Removing a component changes an entity's archetype and results in the entity being moved to a different chunk.

    Important: This function creates a sync point, which means that the EntityManager waits for all currently running Jobs to complete before removing the component and no additional Jobs can start before the function is finished. A sync point can cause a drop in performance because the ECS framework may not be able to make use of the processing power of all available cores.

    RemoveComponent<T>(ForEachLambdaJobDescription)

    Removes a component from a set of entities selected by the query you have defined using WithAny/WithAll/WithNone

    Declaration
    public static void RemoveComponent<T>(this ForEachLambdaJobDescription description) where T : unmanaged, IComponentData
    Parameters
    Type Name Description
    ForEachLambdaJobDescription description

    The target object

    Type Parameters
    Name Description
    T

    The type of component to remove.

    Remarks

    Can remove any kind of component except chunk components.

    It's OK if the component to remove is already missing from some or all of the entities.

    Removing a component changes an entity's archetype and results in the entity being moved to a different chunk.

    Important: This function creates a sync point, which means that the EntityManager waits for all currently running Jobs to complete before removing the component and no additional Jobs can start before the function is finished. A sync point can cause a drop in performance because the ECS framework may not be able to make use of the processing power of all available cores.

    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)