docs.unity3d.com
    Show / Hide Table of Contents

    Method Execute

    Execute(ArchetypeChunk, Int32, Int32)

    Implement the Execute function to perform a unit of work on an ArchetypeChunk representing a contiguous batch of entities within a chunk.

    Declaration
    void Execute(ArchetypeChunk batchInChunk, int batchIndex, int indexOfFirstEntityInQuery)
    Parameters
    Type Name Description
    ArchetypeChunk batchInChunk

    An object providing access to a batch of entities within a chunk.

    Int32 batchIndex

    The index of the current batch within the list of all batches in all chunks found by the job's EntityQuery. Note that batches are not necessarily processed in index order. Guaranteed to be contiguous and zero-based.

    Int32 indexOfFirstEntityInQuery

    The index of the first entity in the current chunk within the list of all entities in all the chunks found by the Job's EntityQuery.

    Remarks

    The chunks selected by the EntityQuery used to schedule the job are the input to your Execute function. If you use to schedule the job, the entities in each matching chunk are distributed to worker threads individually, and the Execute function is called once for each batch (containing a single Entity). When you use one of the other scheduling or run methods, the Execute function is called once per matching chunk.

    Back to top
    Terms of use
    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