docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method NextEntityIndexBatch

    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 NextEntityIndex(out int) 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).

    Declaration
    public bool NextEntityIndexBatch(out int startIndex, out int count)
    Parameters
    Type Name Description
    int startIndex

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

    int count

    The number of consecutive available entities in the run.

    Returns
    Type Description
    bool

    Whether the iteration should continue.

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)