Repository navigation
API Class ParticleSystem
Defined in: src/engine/render/components.ts:674
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:693
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:676
The particle effect asset (asset:effects/sparks.particles.json).
embeddedEffect: Record<string, unknown> | null = null;Defined in: src/engine/render/components.ts:681
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:691
Multiplies emission rates, bursts and the particle limit.
overrides: Record<string, ParticlePropertyValue> = {};Defined in: src/engine/render/components.ts:683
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:685
Start playing when the node is created. Off: wait for play().
seed: number = 0;Defined in: src/engine/render/components.ts:698
Random seed. 0 = a new random sequence every play; any other integer = the same particles every play and restart, for replays, tests and lockstep.
timeScale: number = 1;Defined in: src/engine/render/components.ts:687
Simulation speed (1 = normal), on top of the World's time scale.
tint: Color = Color.white;Defined in: src/engine/render/components.ts:689
Multiplies the particles' start colours.
get enabled(): boolean;Defined in: src/engine/core/Component.ts:57
boolean
set enabled(value): void;Defined in: src/engine/core/Component.ts:61
boolean
void
get gameObject(): GameObject;Defined in: src/engine/core/Component.ts:37
Unity-style alias for node.
get isActiveAndEnabled(): boolean;Defined in: src/engine/core/Component.ts:68
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:756
True while emitting or any particle is still alive.
boolean
get isPlaying(): boolean;Defined in: src/engine/render/components.ts:751
True while emitting (not paused or stopped).
boolean
get node(): GameObject;Defined in: src/engine/core/Component.ts:32
The node this component is on.
get owner(): GameObject;Defined in: src/engine/core/Component.ts:45
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:766
Particles alive now, across every emitter.
number
get playTime(): number;Defined in: src/engine/render/components.ts:761
Seconds since the effect started (or restarted).
number
get time(): Readonly<TimeState>;Defined in: src/engine/core/Component.ts:93
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:51
The Transform of the node this component is on, if it has one.
get world(): WorldHandle;Defined in: src/engine/core/Component.ts:82
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:726
Remove every particle, without stopping.
void
emit(count): void;Defined in: src/engine/render/components.ts:731
Emit count particles at once from every emitter (sub-emitters aside).
number
void
getProperty(name):
| ParticlePropertyValue
| undefined;Defined in: src/engine/render/components.ts:741
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:103
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:711
Freeze the effect where it is; play() resumes it.
void
play(): void;Defined in: src/engine/render/components.ts:706
Start, or resume after pause().
void
restart(): void;Defined in: src/engine/render/components.ts:721
Start again from the beginning, removing the particles already out.
void
sendEvent(name): void;Defined in: src/engine/render/components.ts:746
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:736
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:716
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