Method GetCompanion
GetCompanion<T>(EntityManager, Entity)
Returns the UnityEngine.Component of type T referenced by the entity's companion component.
Declaration
public static T GetCompanion<T>(this EntityManager entityManager, Entity entity) where T : Component
Parameters
| Type | Name | Description |
|---|---|---|
| EntityManager | entityManager | The entity manager that stores |
| Entity | entity | The entity to read the companion component from. |
Returns
| Type | Description |
|---|---|
| T | The |
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
Resolving the reference is a managed call, so call this method from the main thread. Throws
if entity has no CompanionComponent<T>.