Documentation

Unity Engine


Unity Engine


NextEntityIndexBatch(out int, out int)

Iterates through the given ArchetypeChunk a whole contiguous run of available entities at a time, rather than one index at a time as ChunkEntityEnumerator.NextEntityIndex does. A run is a set of adjacent slots that are all available; batching lets a caller process a dense span in one operation. When every entity is available (the common case) this yields a single run [0, chunk.Count).
Read time 1 minuteLast updated 3 days ago

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule

NextEntityIndexBatch(int, int)

public bool NextEntityIndexBatch(out int startIndex, out int count)

Parameters

startIndex

The index of the first entity in the next available run, or -1 when the function returns false.

count

The number of consecutive available entities in the run.

Returns

Type

Description

boolWhether the iteration should continue.