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
The query specifying the entities to destroy.
Controls when the entities matching are computed and captured.
entityQueryDestroyEntity(EntityQuery)
Obsolete. Use EntityCommandBuffer.DestroyEntity instead.
public void DestroyEntity(EntityQuery entityQuery)
Parameters
The query specifying the entities to destroy.