CreateEntity
Creates an entity with no components in the given world.
阅读时间1 分钟最后更新于 1 天前
Definition
- Type: Method
- Namespace: Unity.Entities
- Assembly: UnityEngine.EntitiesModule
CreateEntity(WorldUnmanaged)
Creates an entity with no components in the given world.
public static Entity CreateEntity(WorldUnmanaged world)
Parameters
The world to create the entity in.
Returns
Type | Description |
|---|---|
| Entity | The new entity. |
Remarks
This is a structural change.
CreateEntity(WorldUnmanaged, EntityArchetype)
Creates an entity of an archetype in the given world.
public static Entity CreateEntity(WorldUnmanaged world, EntityArchetype archetype)
Parameters
The world to create the entity in.
An archetype created in .
worldReturns
Type | Description |
|---|---|
| Entity | The new entity. |
Remarks
This is a structural change.
CreateEntity(WorldUnmanaged, ReadOnlySpan<ComponentType>)
Creates an entity with the given components in the given world.
public static Entity CreateEntity(WorldUnmanaged world, ReadOnlySpan<ComponentType> types)
Parameters
The world to create the entity in.
The component types of the new entity.
Returns
Type | Description |
|---|---|
| Entity | The new entity. |
Remarks
This is a structural change.