Repository navigation
API Class ParticleSystem
Defined in: src/engine/render/components.ts:375
Plays a particle effect asset at its node (ADR 0057, 0060): a *.particles.json graph authored
in the Particle Graph. Particles follow the World's time, so pausing time pauses them, and they
are cosmetic: never replicated, simulated on each client.
new ParticleSystem(): ParticleSystem;ParticleSystem
destroyOnFinish: boolean = false;Defined in: src/engine/render/components.ts:394
Destroy the node once a non-looping effect has finished and its last particle is gone.
effect: string = "";Defined in: src/engine/render/components.ts:377
The particle effect asset (asset:effects/sparks.particles.json).
embeddedEffect: Record<string, unknown> | null = null;Defined in: src/engine/render/components.ts:382
Effects are assets (ADR 0060); the editor moves embedded effects into asset files.
Still played, when effect is empty, so scenes saved before then keep working.
emissionScale: number = 1;Defined in: src/engine/render/components.ts:392
Multiplies emission rates and bursts. The particle limit (each emitter's maxParticles) stays as authored.
material: string = "";Defined in: src/engine/render/components.ts:412
With a sortingLayer: a 2D material asset ("sprite-lit", the default when empty, or "sprite-unlit") saying
whether 2D lights light the particles. Their colours and textures stay their outputs'.
orderInLayer: number = 0;Defined in: src/engine/render/components.ts:407
With a sortingLayer: the order within it (higher draws on top), as a SpriteRenderer's.
overrides: Record<string, ParticlePropertyValue> = {};Defined in: src/engine/render/components.ts:384
This instance's values for the effect's exposed properties, by name (set them with setProperty).
playOnAwake: boolean = true;Defined in: src/engine/render/components.ts:386
Start playing when the node is created. Off: wait for play().
seed: number = 0;Defined in: src/engine/render/components.ts:399
Random seed. 0 = a new random sequence every play; any other integer = the same particles every play and restart, for replays, tests and lockstep.
sortingLayer: string = "";Defined in: src/engine/render/components.ts:405
2D (ADR 0415): the sorting layer its particles draw on, among sprites and tiles, at orderInLayer; and with a lit
2D material, lit by 2D lights like them (each output's flat light: no normal maps). Empty: drawn as 3D particles,
ordered by their outputs' render order.
timeScale: number = 1;Defined in: src/engine/render/components.ts:388
Simulation speed (1 = normal), on top of the World's time scale.
tint: Color = Color.white;Defined in: src/engine/render/components.ts:390
Multiplies the particles' start colours.
get enabled(): boolean;Defined in: src/engine/core/Component.ts:62
boolean
set enabled(value): void;Defined in: src/engine/core/Component.ts:66
boolean
void
get gameObject(): GameObject;Defined in: src/engine/core/Component.ts:42
Unity-style alias for node.
get isActiveAndEnabled(): boolean;Defined in: src/engine/core/Component.ts:73
True when enabled, the node is active in the hierarchy, and the node is in a loaded world.
boolean
get isAlive(): boolean;Defined in: src/engine/render/components.ts:475
True while emitting or any particle is still alive.
boolean
get isPlaying(): boolean;Defined in: src/engine/render/components.ts:470
True while emitting (not paused or stopped).
boolean
get node(): GameObject;Defined in: src/engine/core/Component.ts:37
The node this component is on.
get owner(): GameObject;Defined in: src/engine/core/Component.ts:50
The node this component acts for: the node itself when attached directly, or the parent node when this component lives on a component node (ADR 0009).
get particleCount(): number;Defined in: src/engine/render/components.ts:485
Particles alive now, across every emitter.
number
get playTime(): number;Defined in: src/engine/render/components.ts:480
Seconds since the effect started (or restarted).
number
get time(): Readonly<TimeState>;Defined in: src/engine/core/Component.ts:98
This component's World's clock (ADR 0032): the same values as Time, but safe to read
outside the World's frame too (after an await, say).
Readonly<TimeState>
get transform(): Transform;Defined in: src/engine/core/Component.ts:56
The Transform of the node this component is on, if it has one.
get world(): WorldHandle;Defined in: src/engine/core/Component.ts:87
A handle on this component's World (ADR 0132): the same one Engine.findWorld returns. Load
a scene into it, pause, connect or destroy it: this.world.loadScene("scenes/level2.scene.json").
Throws for a World no Engine owns.
clear(): void;Defined in: src/engine/render/components.ts:445
Remove every particle, without stopping.
void
emit(count): void;Defined in: src/engine/render/components.ts:450
Emit count particles at once from every emitter (sub-emitters aside).
number
void
getProperty(name):
| ParticlePropertyValue
| undefined;Defined in: src/engine/render/components.ts:460
This instance's value of an exposed property, or undefined if it uses the effect's own value.
string
| ParticlePropertyValue
| undefined
instantiate(prefabPath, options?): GameObject;Defined in: src/engine/core/Component.ts:108
Instantiate a prefab in this component's World (ADR 0034), like GameObject.instantiate.
Use it in code that may run after an await: by then the frame is over and the current World
is the Engine's default one, which may not be this component's. A parent from another
World throws.
string
InstantiateOptions = {}
pause(): void;Defined in: src/engine/render/components.ts:430
Freeze the effect where it is; play() resumes it.
void
play(): void;Defined in: src/engine/render/components.ts:425
Start, or resume after pause().
void
restart(): void;Defined in: src/engine/render/components.ts:440
Start again from the beginning, removing the particles already out.
void
sendEvent(name): void;Defined in: src/engine/render/components.ts:465
Send a custom event (an Event node named name in the graph), which starts or stops the systems it's wired to.
string
void
setProperty(name, value): void;Defined in: src/engine/render/components.ts:455
Set one of the effect's exposed properties for this instance; it applies on the next frame.
string
void
stop(options?): void;Defined in: src/engine/render/components.ts:435
Stop emitting. Particles already out live out their lives, unless clear removes them at once.
boolean
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