Instance Property

entity

The entity that owns this component.

Declaration

@property(nonatomic, readonly, weak) GKEntity *entity;

Discussion

Use this property in a component subclass to refer back to the owning entity and its attributes. An entity may be an instance either of the GKEntity class or of a custom subclass. In the latter case, a custom entity class can provide storage for state or resources accessed by multiple components.

See Also

Working with Entities

- didAddToEntity

Notifies the component that it has been assigned to an entity.

- willRemoveFromEntity

Notifies the component that it has been removed from an entity.