GetEntity()
Gets the entity that stores this GameObject's components in a World.
Read time 1 minuteLast updated 14 hours ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public Entity GetEntity()
Returns
Type | Description |
|---|---|
| Entity | The entity, with the same index and version as Object.GetEntityId(). |
Remarks
Use the entity with to access the data components of the GameObject. When collections checks are enabled, this method throws an if the GameObject has been destroyed, so its entity doesn't exist.
Unity.Entities.GlobalEntityManagerArgumentException