Skip to main content

Function: addLifetimeComponent()

addLifetimeComponent(world, entity, options): LifetimeEcsComponent

Defined in: lifecycle/components/lifetime-component.ts:42

Attaches a LifetimeEcsComponent to entity.

Parameters​

world​

EcsWorld

The ECS world entity belongs to.

entity​

number

The entity to attach the component to.

options​

LifetimeRequiredOptions & Partial<LifetimeEcsComponent>

Options for configuring the lifetime. durationSeconds has no sensible default and must always be provided.

Returns​

LifetimeEcsComponent

The attached component, for further tuning or runtime changes.