Method Execute
Execute(ArchetypeChunk, 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)
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. These ids are not guaranteed to be contiguous or zero-based. |
Remarks
The chunks selected by the EntityQuery used to schedule the job are the input to your Execute
function. If you use 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.
If you are looking for an interface which provides the firstEntityIndex parameter, IJobEntityBatchWithIndex