Method CreateEntity
CreateEntity(EntityArchetype)
Records a command to create an entity with specified archetype.
Declaration
public Entity CreateEntity(EntityArchetype archetype)
Parameters
Type | Name | Description |
---|---|---|
Entity |
archetype | The archetype of the new entity. |
Returns
Type | Description |
---|---|
Entity | An entity that is deferred and will be fully realized when this EntityCommandBuffer is played back. |
Remarks
At playback, this command throws an error if the archetype contains the Prefab tag.
Exceptions
Type | Condition |
---|---|
Argument |
Throws if the archetype is null. |
Null |
Throws if an Allocator was not passed in when the EntityCommandBuffer was created. |
Invalid |
Throws if this EntityCommandBuffer has already been played back. |
CreateEntity()
Records a command to create an entity with no components.
Declaration
public Entity CreateEntity()
Returns
Type | Description |
---|---|
Entity | An entity that is deferred and will be fully realized when this EntityCommandBuffer is played back. |
Exceptions
Type | Condition |
---|---|
Null |
Throws if an Allocator was not passed in when the EntityCommandBuffer was created. |
Invalid |
Throws if this EntityCommandBuffer has already been played back. |