BehaviorDef
Defined in: behavior.ts:55
Type Parameters
Section titled “Type Parameters”S extends object
Properties
Section titled “Properties”metadata?
Section titled “metadata?”
optionalmetadata?:ComponentMetadata
Defined in: behavior.ts:61
Field-presentation metadata for state (ranges, enums, …), forwarded to the component.
schedule?
Section titled “schedule?”
optionalschedule?:Schedule
Defined in: behavior.ts:59
Schedule the lifecycle system runs in (default Schedule.Update).
state?
Section titled “state?”
optionalstate?:S
Defined in: behavior.ts:57
Per-entity state → a defineComponent, editable in the Details panel.
Methods
Section titled “Methods”destroy()?
Section titled “destroy()?”
optionaldestroy(ctx):void
Defined in: behavior.ts:67
Run once when the component is removed OR the entity is despawned.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
start()?
Section titled “start()?”
optionalstart(ctx):void
Defined in: behavior.ts:63
Run once, the frame the behavior’s component first appears on an entity.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
update()?
Section titled “update()?”
optionalupdate(ctx,dt):void
Defined in: behavior.ts:65
Run every frame for each entity carrying the behavior. dt == ctx.time.delta.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void