# Common module

# Overview

Common (Common module of particle system), used to set the initial attribute values ​​of particles, such as initial velocity, rotation, color, life time, etc.

image.png

# Property description

Property Function Type
startLifeTime The life time of the particle. number
scalingMode Scaling mode. engine.Particle.ParticleCommon.ScalingMode
    Hierarchy Indicates that the size of the particle is affected by the superposition of the zoom value of itself and all parent nodes.
(For 2d particles, the particle size will be affected by the design width and height, you need to set transform2D.scale to a larger value to display)
engine.Particle.ParticleCommon.ScalingMode.Hierarchy
    Local Local means that the size of the particle is only affected by its own zoom value.
** (For 2d particles, the particle size is not affected by the design width and height changes, and the particle size value is directly set to the clipping space) **
engine.Particle.ParticleCommon.ScalingMode.Local
    Shape Shape means that the size of the particle is not affected by the zoom value of itself and its parent node.
** (For 2d particles, the particle size is not affected by the design width and height changes, and the particle size value is directly set to the clipping space) **
engine.Particle.ParticleCommon.ScalingMode.Shape
simulationSpace The space where the simulation particles are located. engine.Particle.ParticleCommon.SimulationSpace
    Local The particles are in local space. engine.Particle.ParticleCommon.SimulationSpace.Local
    World The particle is in world space. engine.Particle.ParticleCommon.SimulationSpace.World
startSpeed The initial speed of each particle. engine.Particle.AdvancedProperty.ConstantProperty
engine.Particle.AdvancedProperty.TwoConstantsProperty
engine.Particle.AdvancedProperty.CurveProperty
engine.Particle.AdvancedProperty.TwoCurvesProperty
startSize3D Whether to enable the size settings in the three directions of XYZ. boolean
startSize If startSize3D is false, the initial size of each particle. engine.Particle.AdvancedProperty.ConstantProperty
engine.Particle.AdvancedProperty.TwoConstantsProperty
engine.Particle.AdvancedProperty.CurveProperty
engine.Particle.AdvancedProperty.TwoCurvesProperty
startSizeX If startSize3D is true, the initial size of the particle in the X-axis direction. engine.Particle.AdvancedProperty.ConstantProperty
engine.Particle.AdvancedProperty.TwoConstantsProperty
engine.Particle.AdvancedProperty.CurveProperty
engine.Particle.AdvancedProperty.TwoCurvesProperty
startSizeY If startSize3D is true, the initial size of the particle in the Y-axis direction. engine.Particle.AdvancedProperty.ConstantProperty
engine.Particle.AdvancedProperty.TwoConstantsProperty
engine.Particle.AdvancedProperty.CurveProperty
engine.Particle.AdvancedProperty.TwoCurvesProperty
startSizeZ If startSize3D is true, the initial size of the particle in the Z-axis direction. engine.Particle.AdvancedProperty.ConstantProperty
engine.Particle.AdvancedProperty.TwoConstantsProperty
engine.Particle.AdvancedProperty.CurveProperty
engine.Particle.AdvancedProperty.TwoCurvesProperty
startRotation3D Whether to enable the rotation settings in the three directions of XYZ. boolean
startRotation If startSize3D is false, the initial rotation angle of each particle. engine.Particle.AdvancedProperty.ConstantProperty
engine.Particle.AdvancedProperty.TwoConstantsProperty
engine.Particle.AdvancedProperty.CurveProperty
engine.Particle.AdvancedProperty.TwoCurvesProperty
startRotationX If startSize3D is true, the initial rotation angle of each particle on the X axis. engine.Particle.AdvancedProperty.ConstantProperty
engine.Particle.AdvancedProperty.TwoConstantsProperty
engine.Particle.AdvancedProperty.CurveProperty
engine.Particle.AdvancedProperty.TwoCurvesProperty
startRotationY If startSize3D is true, the initial rotation angle of each particle on the Y axis. engine.Particle.AdvancedProperty.ConstantProperty
engine.Particle.AdvancedProperty.TwoConstantsProperty
engine.Particle.AdvancedProperty.CurveProperty
engine.Particle.AdvancedProperty.TwoCurvesProperty
startRotationZ If startSize3D is true, the initial rotation angle of each particle on the Z axis. engine.Particle.AdvancedProperty.ConstantProperty
engine.Particle.AdvancedProperty.TwoConstantsProperty
engine.Particle.AdvancedProperty.CurveProperty
engine.Particle.AdvancedProperty.TwoCurvesProperty
startColor The initial color of each particle. engine.Particle.AdvancedProperty.OneColorProperty
engine.Particle.AdvancedProperty.TwoColorsProperty
engine.Particle.AdvancedProperty.GradientProperty
engine.Particle.AdvancedProperty.TwoGradientsProperty

Notice:

For 2d particles, the size attribute of transform2d will not have any effect on the particle size. The scaling of 2d particles depends on the scalingMode attribute in the common module. When scalingMode is Local and Shape, the particles are not affected by the world matrix, so they will not change with the design width and height, and directly enter the clipping space. When scalingMode is Hierarchy, the particles will be affected by the world matrix, because the 2d world matrix will be scaled according to the design width and height, so the scale property of transform2D needs to be set to a corresponding multiple to see the particles.

点击咨询小助手