Files
engine/docs/en/graphics/particle/renderer-size-module.md
2024-09-05 11:13:54 +08:00

2.2 KiB

order, title, type, group, label
order title type group label
3 Size Over Lifetime Module Graphics Particle Graphics/Particle

SizeOverLifetimeModule is a subclass of ParticleGeneratorModule used to handle size changes over the lifetime of a particle system.

avatar

Properties

Property Description
separateAxes Boolean value specifying whether the size changes independently for each axis
sizeX ParticleCompositeCurve object representing the size change curve along the x-axis
sizeY ParticleCompositeCurve object representing the size change curve along the y-axis
sizeZ ParticleCompositeCurve object representing the size change curve along the z-axis
size ParticleCompositeCurve object to get or set the size change curve of particles

Polyline Editing

For the ParticleCompositeCurve object, a polyline editor is built into the editor for visual curve adjustments.

avatar

Or in code:

sizeOverLifetime.enabled = true;
sizeOverLifetime.size.mode = ParticleCurveMode.Curve;

const curve = sizeOverLifetime.size.curve;
const keys = curve.keys;
keys[0].value = 0.153;
keys[1].value = 1.0;
curve.addKey(0.057, 0.37);
curve.addKey(0.728, 0.958);