Documentation

Unity Engine


Unity Engine


DestroyEntity

Records a command to destroy an entity.
Read time 1 minuteLast updated a day ago

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule

DestroyEntity(Entity)

Records a command to destroy an entity.
public void DestroyEntity(Entity e)

Parameters

The entity to destroy.

Remarks

At playback, this command throws an error if the entity was destroyed between recording and playback, or if the entity has the Prefab tag.

DestroyEntity(NativeArray<Entity>)

Records a command to destroy a NativeArray of entities.
public void DestroyEntity(NativeArray<Entity> entities)

Parameters

The NativeArray of entities to destroy.

Remarks

At playback, this command only runs if the entity count is greater than 0. This command throws an error if any of the entities were destroyed between recording and playback, or if any of the entities have the Prefab tag.

DestroyEntity(EntityQuery, EntityQueryCaptureMode)

Records a command to destroy all entities matching a query.
public void DestroyEntity(EntityQuery entityQuery, EntityQueryCaptureMode queryCaptureMode)

Parameters

entityQuery

The query specifying the entities to destroy.

queryCaptureMode

Controls when the entities matching
entityQuery
are computed and captured.

DestroyEntity(EntityQuery)

Obsolete. Use EntityCommandBuffer.DestroyEntity instead.
Warning
Deprecated. This method now takes an extra parameter to control when the query is evaluated. To preserve the current semantics, use EntityQueryCaptureMode.AtRecord (RemovedAfter Entities 2.0)
public void DestroyEntity(EntityQuery entityQuery)

Parameters

entityQuery

The query specifying the entities to destroy.