Skip to main content

Function: addParentComponent()

addParentComponent(world, entity, options): ParentEcsComponent

Defined in: common/components/parent-component.ts:21

Attaches a ParentEcsComponent to entity.

Parameters

world

EcsWorld

The ECS world entity belongs to.

entity

number

The entity to attach the component to.

options

ParentEcsComponent

Options for configuring the parent. parent (the parent entity's id) has no sensible default and must always be provided.

Returns

ParentEcsComponent

The attached component, for further tuning or runtime changes.