Files
feuerwerk/src/core/graph/nodes/events/OnEnable.ts
T
rootandClaude Fable 5.1 6141d07d4f
game-maker / suite (push) Successful in 7m29s
Behavior lifecycle: On enable, On disable and On destroy events (#42)
Order per instance: On start -> On enable -> On update ... -> On disable
-> On destroy. On enable fires right after On start and whenever the
behavior comes back on (itself and its parents); On disable in the frame
it goes off, the instance stays frozen. On destroy fires when the entity
leaves the world (Destroy node, child of a destroyed object) and when the
world is torn down on stop/restart, preceded by On disable if still on.
A new On start node added while playing still does not fire for a
running instance (kept as is, documented in the wiki).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-12 21:21:35 +02:00

13 lines
335 B
TypeScript

import type { NodeDef } from '../../NodeRegistry';
import { exec } from '../shared';
export const OnEnable: NodeDef = {
type: 'OnEnable',
label: 'On enable',
category: 'event',
description: 'Runs right after On start, and again each time the behavior is switched back on.',
inputs: [],
outputs: [exec()],
params: [],
};