Documentation

Unity Engine

Download Unity

Unity Engine

GetEntity()

Gets the entity that stores this GameObject's components in a World.
Read time 1 minuteLast updated 14 hours ago

Definition

public Entity GetEntity()

Returns

Type

Description

EntityThe entity, with the same index and version as Object.GetEntityId().

Remarks

Use the entity with
Unity.Entities.GlobalEntityManager
to access the data components of the GameObject. When collections checks are enabled, this method throws an
ArgumentException
if the GameObject has been destroyed, so its entity doesn't exist.