MainModule is the primary module of the ParticleGeneratorModule
, containing the most basic particle generation parameters. Most of these properties are used to control the initial state of newly created particles.
You can debug each property in the provided example to better understand and control the particle main module, thereby achieving various complex and beautiful visual effects.
Property | Description |
---|---|
duration | Duration. Determines how long the particle generator runs, in seconds. A longer duration means the particle system will generate more particles, creating a continuous effect. |
isLoop | Whether to loop. If set to true, the particle generator will automatically restart after the duration ends, forming a continuous effect like smoke or flowing water. |
startDelay | Start delay time. Determines how long the particle generator waits before emitting particles after starting. Useful for achieving effects like fireworks that require a time delay. |
startLifetime | Initial lifetime. Determines how long each particle can survive before disappearing. A longer lifetime means particles will stay on the screen longer. |
startSpeed | Initial speed when particles are first generated. Determines the speed at which particles are emitted. A higher initial speed will cause particles to spread rapidly, like an explosion effect; a lower speed will make particles float slowly, like smoke. |
startSize3D | Whether to specify particle size separately for each axis. Allows setting different sizes for the particle's x, y, and z axes, creating anisotropic particle effects, such as elongated flames. |
startSize | Initial size when the particle generator first generates particles. Controls the size of each particle. A larger initial size is suitable for simulating large clouds of smoke or flames, while a smaller size is suitable for delicate dust or splashes. |
startSizeX | Initial size along the x-axis when the particle generator first generates particles. |
startSizeY | Initial size along the y-axis when the particle generator first generates particles. |
startSizeZ | Initial size along the z-axis when the particle generator first generates particles. |
startRotation3D | Whether to enable 3D particle rotation. Allows particles to rotate in 3D space, increasing their sense of depth and complexity, such as falling leaves in three-dimensional space. |
startRotation | Initial rotation when the particle generator first generates particles. Sets the rotation angle at particle emission, suitable for effects where particles need to move in a specific direction, such as directional flames. |
startRotationX | Initial rotation along the x-axis at particle emission. |
startRotationY | Initial rotation along the y-axis at particle emission. |
startRotationZ | Initial rotation along the z-axis at particle emission. |
flipRotation | Flip rotation. Ranges from 0 to 1, causing some particles to rotate in the opposite direction, increasing the randomness and naturalness of the particle system, suitable for simulating complex motion trajectories. |
startColor | Initial color. Determines the color of particles, which can be used to simulate effects of different materials, such as the red-orange color of flames or the gray-white color of smoke. |
gravityModifier | Gravity modifier. Adjusts the extent to which particles are affected by gravity, making them appear more realistic, such as falling raindrops or rising smoke. |
simulationSpace | Chooses the space in which particles are simulated. Determines whether particles move relative to the world or relative to the generator itself. World space is suitable for stationary effects like smoke; local space is suitable for effects that move with the object, such as flame trails. |
simulationSpeed | Simulation speed. Can globally speed up or slow down the movement speed of particles, suitable for slow motion or accelerated effects. |
scalingMode | Scaling mode. Determines how the particle generator handles transformations such as position, rotation, and scaling when emitting particles. Using scalingMode ensures that the transformation relationship between the particle generator and the particles meets expectations. |
playOnEnabled | If set to true, the particle generator will automatically start playing on launch. Enabling this option ensures that the particle system starts emitting particles as soon as it is activated, suitable for scenarios where immediate effects are needed. |
maxParticles | Maximum particles. Limits the maximum number of particles in the particle system to prevent performance issues. A larger value is suitable for effects that require a large number of particles, such as dense smoke. |
The scalingMode has the following options: