docs.unity.cn
    Show / Hide Table of Contents

    Enum EntityQueryCaptureMode

    Specifies when an EntityQuery passed to an EntityCommandBuffer should be evaluated.

    Namespace: Unity.Entities
    Syntax
    public enum EntityQueryCaptureMode
    Remarks

    This can significantly affect which entities are matched by the query, as well as the overall performance of the requested operation.

    Fields

    Name Description Value
    AtRecord

    Request that the query's results be captured immediately, when the command is recorded.


    The entire array of matching entities will be serialized into the command buffer, and this exact set of entities will be processed at playback time. This approach is far less efficient, but may lead to a more predictable set of entities being processed.

    At playback time, the command throws 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.)

    0
    AtPlayback

    Request that the query's results be captured when the corresponding command is played back.


    Only a reference to the query itself is serialized into the command buffer. The requested operation is applied to the query during playback. This approach is generally far more efficient, but may lead to unexpected entities being processed (if entities which match the query are created or destroyed between recording the command buffer and playing it back).

    Since the serialized query is stored by reference, modifying or deleting the query after the command is recorded may affect the set of chunks and entities matched at playback time.

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