Documentation

Unity Engine


Unity Engine


Exists(Entity)

Checks if the entity exists inside this system's EntityManager.
Read time 1 minuteLast updated 2 days ago

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule
public static bool Exists(Entity entity)

Parameters

entity

The entity to check

Returns

Type

Description

boolTrue if the given entity exists or the entity has a Cleanup Component that is yet to be destroyed

Remarks

This returns true for an entity that was destroyed with DestroyEntity, but still has a cleanup component. Prefer ComponentLookup<T>.TryGetComponent where applicable. Can be used inside of Entities.ForEach.
Not working in IJobEntity, and Utility methods
Additional Resources: EntityManager.Exists