Functions for controlling particle effect component playback and shader constants.
Static methods
staticplay<T>(url:UrlOrString, ?emitter_state_cb:(T, Hash, Hash, ParticlefxEmitterState) ‑> Void):Void
Start playing a particle FX.
Particle FX started this way need to be manually stopped through Particlefx.stop
.
Which particle FX to play is identified by the URL.
Parameters:
url | the particle fx that should start playing |
---|---|
emitter_state_cb | optional callback that will be called when an emitter attached to this particlefx changes state. The callback receives the hash of the path to the particlefx, the hash of the id of the emitter, and the new state of the emitter. |
staticreset_constant(url:UrlOrString, emitter_id:HashOrString, name:HashOrString):Void
Reset a shader constant for a particle FX emitter.
The constant must be defined in the material assigned to the emitter. Resetting a constant through this function implies that the value defined in the material will be used. Which particle FX to reset a constant for is identified by the URL.
Parameters:
url | the particle FX that should have a constant reset |
---|---|
emitter_id | the id of the emitter |
name | the name of the constant |
staticset_constant(url:UrlOrString, emitter_id:HashOrString, name:HashOrString, value:Vector4):Void
Set a shader constant for a particle FX emitter.
The constant must be defined in the material assigned to the emitter. Setting a constant through this function will override the value set for that constant in the material. The value will be overridden until particlefx.reset_constant is called. Which particle FX to set a constant for is identified by the URL.
Parameters:
url | the particle FX that should have a constant set |
---|---|
emitter_id | the id of the emitter |
name | the name of the constant |
value | the value of the constant |
staticstop(url:UrlOrString):Void
Stop playing a particle fx.
Stopping a particle FX does not remove the already spawned particles. Which particle fx to stop is identified by the URL.
Parameters:
url | the particle fx that should stop playing |
---|