文档

Unity Engine

Download Unity

Unity Engine

ChunkEntityEnumerator

Helper utility to quickly identify the next available entity or component within a chunk (e.g. the index of the NativeArray<T> retrieved via ArchetypeChunk.GetComponentDataPtrRW or ArchetypeChunk.GetEntityDataPtrRO )
阅读时间1 分钟最后更新于 20 天前

Definition

  • Type: Struct
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule
public struct ChunkEntityEnumerator

Constructors

Methods

Method

Description

IsSparseReturns whether the available entities are not a single contiguous run starting at slot 0 (i.e. there are gaps between available entities). A fully-available chunk returns false. Does not consume any entities, so it may be called before iterating.
NextEntityIndexIterates through the given ArchetypeChunk, retrieving the index of the next available entity as defined by the mask info provided to the constructor.
NextEntityIndexBatchIterates 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)
.