| Parameter | Description |
|---|---|
| sortKey | A unique index for each set of commands added to this EntityCommandBuffer across all parallel jobs writing commands to this buffer. The ChunkIndexInQuery provided by IJobEntity is an appropriate value to use for this parameter. In an IJobChunk pass the 'unfilteredChunkIndex' value from IJobChunk.Execute. |
| archetype | The archetype of the new entity. |
Entity An entity that will be assigned a chunk when this EntityCommandBuffer is played back.
Records a command to create an entity with specified archetype.
At playback, this command will throw an error if the archetype contains the Prefab tag.
| Parameter | Description |
|---|---|
| sortKey | A unique index for each set of commands added to this EntityCommandBuffer across all parallel jobs writing commands to this buffer. The ChunkIndexInQuery provided by IJobEntity is an appropriate value to use for this parameter. In an IJobChunk pass the 'unfilteredChunkIndex' value from IJobChunk.Execute. |
Entity An entity that will be assigned a chunk when this EntityCommandBuffer is played back.
Records a command to create an entity with no components.
| Parameter | Description |
|---|---|
| sortKey | A unique index for each set of commands added to this EntityCommandBuffer across all parallel jobs writing commands to this buffer. The ChunkIndexInQuery provided by IJobEntity is an appropriate value to use for this parameter. In an IJobChunk pass the 'unfilteredChunkIndex' value from IJobChunk.Execute. |
| archetype | The archetype of the new entities. |
| entities | An array to hold the Entity objects needed to access the new entities. The length of the array determines how many entities are created. |
Records a command to create an array of entities with specified archetype.
At playback, this command throws an error if the archetype contains the Prefab tag.
| Parameter | Description |
|---|---|
| sortKey | A unique index for each set of commands added to this EntityCommandBuffer across all parallel jobs writing commands to this buffer. The ChunkIndexInQuery provided by IJobEntity is an appropriate value to use for this parameter. In an IJobChunk pass the 'unfilteredChunkIndex' value from IJobChunk.Execute. |
| count | The number of entities to create. |
| allocator | The allocator to use for the returned array. |
NativeArray<Entity> An array of the created entities. Each entity is valid immediately, but Unity doesn't assign it a chunk until the Playback method runs.
Records a command to create a specified number of entities with no components.