docs.unity.cn
    Show / Hide Table of Contents

    Method DestroyEntitiesForEntityQuery

    DestroyEntitiesForEntityQuery(EntityQuery)

    Records a command to destroy all entities matching a query.

    Declaration
    public void DestroyEntitiesForEntityQuery(EntityQuery entityQuery)
    Parameters
    Type Name Description
    EntityQuery entityQuery

    The query specifying the entities to destroy.

    Remarks

    The set of entities matching the query is 'captured' in the method call, and the recorded command stores an array of all these entities.

    Behavior at Playback: Will throw an error if one of these entities is destroyed before playback. (With safety checks enabled, an exception is thrown. Without safety checks, playback will perform invalid and unsafe memory access.)

    Exceptions
    Type Condition
    NullReferenceException

    Throws if an Allocator was not passed in when the EntityCommandBuffer was created.

    InvalidOperationException

    Throws if this EntityCommandBuffer has already been played back.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Wednesday, July 6, 2022
    Terms of use