docs.unity.cn
    Show / Hide Table of Contents

    Method RemoveChunkComponentData

    RemoveChunkComponentData<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 RemoveChunkComponentData<T>(this ForEachLambdaJobDescription description)
        where T : struct, IComponentData
    Parameters
    Type Name Description
    Unity.Entities.CodeGeneratedJobForEach.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.

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Thursday, August 10, 2023