docs.unity3d.com
    Show / Hide Table of Contents

    Method DestroyEntity

    DestroyEntity(EntityQuery)

    Destroy all entities having a common set of component types.

    Declaration
    public void DestroyEntity(EntityQuery entityQuery)
    Parameters
    Type Name Description
    EntityQuery entityQuery
    Remarks

    Since entities in the same chunk share the same component structure, this function effectively destroys the chunks holding any entities identified by the entityQueryFilter parameter.

    DestroyEntity(NativeArray<Entity>)

    Destroys all entities in an array.

    Declaration
    public void DestroyEntity(NativeArray<Entity> entities)
    Parameters
    Type Name Description
    NativeArray<Entity> entities

    An array containing the Entity objects of the entities to destroy.

    Remarks

    Important: This function creates a sync point, which means that the EntityManager waits for all currently running Jobs to complete before destroying the entity 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.

    DestroyEntity(NativeSlice<Entity>)

    Destroys all entities in a slice of an array.

    Declaration
    public void DestroyEntity(NativeSlice<Entity> entities)
    Parameters
    Type Name Description
    NativeSlice<Entity> entities

    The slice of an array containing the Entity objects of the entities to destroy.

    Remarks

    Important: This function creates a sync point, which means that the EntityManager waits for all currently running Jobs to complete before destroying the entity 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.

    DestroyEntity(Entity)

    Destroys an entity.

    Declaration
    public void DestroyEntity(Entity entity)
    Parameters
    Type Name Description
    Entity entity

    The Entity object of the entity to destroy.

    Remarks

    Important: This function creates a sync point, which means that the EntityManager waits for all currently running Jobs to complete before destroying the entity 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
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023