Repository navigation
API Interface LifecycleHooks
Defined in: src/engine/core/Component.ts:150
Lifecycle hooks a GameBehavior may implement (ADR 0007). All are optional.
awake?(): void | Promise<void>;Defined in: src/engine/core/Component.ts:151
void | Promise<void>
fixedUpdate?(): void;Defined in: src/engine/core/Component.ts:154
void
lateUpdate?(): void;Defined in: src/engine/core/Component.ts:156
void
onAudioMarker?(e): void;Defined in: src/engine/core/Component.ts:197
A marker passing in the playlist an AudioSource on this node plays (ADR 0343): the Cue, Exit and Hit markers of its
samples and its sequences' cue and exit markers, every type (e.type says which), delivered by the audio system
(late update) on the first frame whose heard clock has passed it (e.time is exact). A playlist's beats and bars
reach onMusicBeat/onMusicBar from there too. Defining the hook is the subscription; the handle's
onMarker(type, fn) is the same for scripts that hold the handle.
void
onCollisionEnter?(collision): void;Defined in: src/engine/core/Component.ts:168
A Collision2D in 2D physics, a Collision in 3D physics: annotate the parameter with the one your game uses.
void
onCollisionExit?(collision): void;Defined in: src/engine/core/Component.ts:171
void
onCollisionStay?(collision): void;Defined in: src/engine/core/Component.ts:170
Every fixed step after onCollisionEnter while the two still touch (ADR 0093).
void
onControllerColliderHit?(hit): void;Defined in: src/engine/core/Component.ts:175
A CharacterController or CharacterController2D on this node ran into a collider during move (ADR 0091): a ControllerColliderHit or ControllerColliderHit2D.
void
onDestroy?(): void;Defined in: src/engine/core/Component.ts:158
void
onDisable?(): void;Defined in: src/engine/core/Component.ts:157
void
onEnable?(): void;Defined in: src/engine/core/Component.ts:152
void
onJointBreak?(
joint,
force,
torque
): void;Defined in: src/engine/core/Component.ts:173
A Joint or Joint2D on this node broke (its breakForce or breakTorque was exceeded); it is destroyed after this (ADR 0092).
number
number
void
onMusicBar?(e): void;Defined in: src/engine/core/Component.ts:184
The first beat of each bar of that music (e.beat is 1), delivered as onMusicBeat is.
void
onMusicBeat?(e): void;Defined in: src/engine/core/Component.ts:182
A beat of the playlist an AudioSource on this node plays, when its playing entry has a tempo (a Sequence with a
tempo, or a sample with one): delivered by the audio system (late update) on the first frame whose heard clock has
passed it. After a gap of more than one beat the beats coalesce into one call with e.missed set (ADR 0166, 0343).
Defining the hook is the subscription. e is reused: read it during the call, don't keep it.
void
onMusicCue?(e): void;Defined in: src/engine/core/Component.ts:189
A cue of ADR 0166's music events. Playlists report cues as markers (onAudioMarker), so it isn't called for them
(ADR 0343); kept so old scripts still compile.
void
onTriggerEnter?(other): void;Defined in: src/engine/core/Component.ts:163
The other collider: a Collider2D in 2D physics, a Collider in 3D physics (the physics plugins, ADR
0135). Annotate the parameter with the one your game uses: onTriggerEnter(other: Collider2D).
void
onTriggerExit?(other): void;Defined in: src/engine/core/Component.ts:166
void
onTriggerStay?(other): void;Defined in: src/engine/core/Component.ts:165
Every fixed step after onTriggerEnter while the two still overlap (ADR 0093).
void
start?(): void | Promise<void>;Defined in: src/engine/core/Component.ts:153
void | Promise<void>
update?(): void;Defined in: src/engine/core/Component.ts:155
void
This wiki is generated from docs/wiki/ and the myco module's source on every push to master. Change pages there in a pull request: edits made here are not kept.
Basics
Gameplay
Rendering
Audio
- Playing sound
- Why is there no sound?
- Playlists
- Interactive music
- Sound generators
- Spatial audio
- Audio mixer
- Live mixing
- Loudness
- Audio profiler
- Audio takes
Reference