Documentation

Unity Engine

Download Unity

Unity Engine

CreateEntity

Creates an entity with no components in the given world.
Read time 1 minuteLast updated a day ago

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

EntityThe 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
world
.

Returns

Type

Description

EntityThe 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

EntityThe new entity.

Remarks

This is a structural change.