Skip to content

ParticleSystem

extends Component

The ParticleSystem class is used to create and manage particle systems.

You can obtain the ParticleSystem component in the following way:

typescript
let obj = new GameObject();
let com = obj.AddComponent<ParticleSystem>(ParticleSystem);

成员变量

ParticleSystem.emissionModuleBurstsCount : number
The burst count of the emitter module.
ParticleSystem.playState : PlayState
(Read Only) The play state.
ParticleSystem.initialModuleMaxParticles : number
The maximum number of particles to emit.
ParticleSystem.startDelay : PSCurve
Startup delay curve.
ParticleSystem.useScaledTime : boolean
Whether to use scaled delta time.
ParticleSystem.velocityModuleLinearVelocityY : PSCurve
A curve that linearly controls the velocity of particles along the Y-axis.
ParticleSystem.initialModuleUse3DRotation : boolean
Whether to enable 3D particle rotation.
ParticleSystem.looping : boolean
Whether the particle system loops.
ParticleSystem.renderModulePivot : Vector3
The pivot point for rotating particles.
ParticleSystem.randomSeed : number
The random seed of the particle system.
ParticleSystem.shapeModuleAlignToDirection : boolean
Whether to align particles based on their initial direction of travel.
ParticleSystem.duration : number
The duration of the particle system.
ParticleSystem.initialModuleRotationZ : PSCurve
The initial rotation around the z-axis when particles are emitted.
ParticleSystem.simulationSpeed : number
Particle simulation speed.
ParticleSystem.velocityModuleOffsetX : PSCurve
Specifies a custom rotation center with X-axis and radial velocity.
ParticleSystem.sizeByVelocityModuleSpeedRange : Vector2
The minimum and maximum speed between size curves.
ParticleSystem.autoRandomSeed : boolean
Whether to use automatic random seed.
ParticleSystem.simulationSpace : PSSimulationSpace
Simulates the particle space.
ParticleSystem.renderModuleSortMode : PSSortMode
The sorting mode of particles.
ParticleSystem.shapeModuleRotation : Vector3
The rotation of the emitter.
ParticleSystem.velocityModuleOrbitalVelocityX : PSCurve
The curve that controls the particle velocity based on the lifetime around the x-axis.
ParticleSystem.playOnAwake : boolean
Whether to automatically play on startup.
ParticleSystem.shapeModuleSpherizeDirection : number
The direction in which particles move along a spherical path from the starting point.
ParticleSystem.velocityModuleOffsetZ : PSCurve
Specifies a custom rotation center with Z-axis and radial velocity.
ParticleSystem.simulationSpaceCustom : Transform
Custom particle simulation space.
ParticleSystem.initialModuleSizeY : PSCurve
The initial size along the y-axis when particles are first generated in the particle system.
ParticleSystem.emitterVelocityMode : PSEmitterVelocityMode
The emitter velocity mode of the particle system emitter velocity module.
ParticleSystem.shapeModuleAngle : number
The cone angle for emitting particles.
ParticleSystem.emitterVelocityCustom : Vector3
Custom value for emitter velocity.
ParticleSystem.scalingMode : PSScalingMode
The scaling mode of the particle system.
ParticleSystem.initialModuleLifetime : PSCurve
Particle initial lifetime curve.
ParticleSystem.velocityModuleOrbitalVelocityZ : PSCurve
A curve that controls the velocity of particles around the z-axis based on their lifetime.
ParticleSystem.initialModuleSpeed : PSCurve
The initial size of particles when the particle system first generates them.
ParticleSystem.forceModuleSpace : PSForceSpace
Particle System Force Field Space.
ParticleSystem.initialModuleColor : PSGradient
Initial minimum-maximum color gradient.
ParticleSystem.initialModuleSizeX : PSCurve
The initial size along the x-axis when particles are first generated in the particle system.
ParticleSystem.shapeModuleRandomizeDirection : number
Randomizes the initial direction of particles.
ParticleSystem.initialModuleSizeZ : PSCurve
The initial size along the z-axis when particles are first generated by the particle system.
ParticleSystem.velocityModuleLinearVelocityX : PSCurve
A curve that linearly controls the velocity of particles along the x-axis.
ParticleSystem.initialModuleRotationX : PSCurve
The initial rotation around the x-axis when particles are emitted.
ParticleSystem.initialModuleRotationY : PSCurve
The initial rotation around the y-axis when particles are emitted.
ParticleSystem.shapeModuleLength : number
The length of the cone from which particles are emitted.
ParticleSystem.shapeModuleRadius : any
The diameter of the emitter.
ParticleSystem.renderModuleCameraScale : number
Stretch based on camera velocity.
ParticleSystem.initialModuleFlipRotation : number
Flip Rotation.
ParticleSystem.rotationModuleAngularVelocityX : PSCurve
Angular velocity of rotation speed on the x-axis.
ParticleSystem.shapeModuleDonutRadius : number
The thickness of the donut shape from which particles are emitted.
ParticleSystem.initialModuleUse3DSize : boolean
Whether to enable 3D size.
ParticleSystem.emissionModuleEnable : boolean
Whether the emitter module is enabled.
ParticleSystem.emissionModuleRateOverTime : PSCurve
The rate at which the emitter generates new particles over time.
ParticleSystem.emissionModuleRateOverDisatance : PSCurve
The rate at which the particle system emits new particles over distance.
ParticleSystem.shapeModuleRadiusThickness : number
The shape radius thickness of the emitter.
ParticleSystem.shapeModuleEnable : boolean
Whether to enable the emission shape module.
ParticleSystem.shapeModuleBoxThickness : Vector3
The thickness of the box from which particles are emitted.
ParticleSystem.shapeModulePosition : Vector3
The position of the emitter.
ParticleSystem.shapeModuleScale : Vector3
The scale of the emitter.
ParticleSystem.shapeModuleType : PSShapeType
The shape type of the emitter (Mesh is currently not available).
ParticleSystem.shapeModuleStyle : PSShapeStyle
Emission mode.
ParticleSystem.velocityLimitationModuleDampen : number
Controls the degree of suppression of particle velocity that exceeds the speed limit.
ParticleSystem.velocityModuleEnable : boolean
Specifies whether the velocityModule is enabled or disabled.
ParticleSystem.shapeModuleRandomizePosition : number
Randomizes the starting position of particles.
ParticleSystem.shapeModuleArc : any
The angle of the arc from which particles are emitted.
ParticleSystem.velocityModuleVelocitySpace : PSVelocitySpace
Specifies whether the velocity is in local space (relative to the transform rotation) or world space.
ParticleSystem.velocityModuleLinearVelocityZ : PSCurve
The curve that linearly controls the velocity of particles on the Z-axis.
ParticleSystem.velocityModuleOrbitalVelocityY : PSCurve
A curve that controls the velocity of particles around the y-axis based on their lifetime.
ParticleSystem.velocityModuleSpeedModifier : PSCurve
A curve that controls the speed of particles based on their lifetime, without affecting the direction of the particles.
ParticleSystem.velocityModuleRadialVelocity : PSCurve
A curve that controls the velocity of particles based on their lifetime, away from the center position.
ParticleSystem.forceModuleForceY : PSCurve
Applies linear force along the local Y-axis to particles within the force field volume.
ParticleSystem.velocityModuleOffsetY : PSCurve
Specifies a custom rotation center with Y-axis and radial velocity.
ParticleSystem.velocityLimitationModuleEnable : boolean
ParticleSystem.velocityLimitationModuleSeparateAxes : boolean
Set speed limits for each axis separately.
ParticleSystem.velocityLimitationModuleVelocitySpace : PSVelocitySpace
Specifies whether the velocity limitation is applied in local coordinate space (relative to the transform rotation) or in world coordinate space.
ParticleSystem.velocityLimitationModuleVelocity : PSCurve
The maximum velocity curve when each axis does not use a separate curve.
ParticleSystem.velocityLimitationModuleVelocitySeparateX : PSCurve
The maximum velocity curve along the X-axis.
ParticleSystem.velocityLimitationModuleVelocitySeparateY : PSCurve
The maximum velocity curve along the Y-axis.
ParticleSystem.velocityLimitationModuleVelocitySeparateZ : PSCurve
The maximum velocity curve along the Z-axis.
ParticleSystem.velocityLimitationModuleDrag : PSCurve
Controls the magnitude of the drag applied to the particle velocity.
ParticleSystem.velocityLimitationModuleDragMultiplyBySize : boolean
Adjusts the amount of drag applied to particles by this module based on their size.
ParticleSystem.velocityLimitationModuleDragMultiplyByVelocity : boolean
Adjusts the amount of drag applied to particles by this module based on their velocity.
ParticleSystem.velocityInheritModuleEnable : boolean
Specifies whether the InheritVelocityModule is enabled or disabled.
ParticleSystem.velocityInheritModuleInheritMode : PSVelocityInheritMode
Emitter velocity mode.
ParticleSystem.rotationModuleAngularVelocityY : PSCurve
Angular velocity of rotation speed on the y-axis.
ParticleSystem.velocityInheritModuleMultiplier : PSCurve
Curve multiplier.
ParticleSystem.forceModuleEnable : boolean
Enables the Particle System Force module.
ParticleSystem.forceModuleRandomize : boolean
Whether to apply randomness to the axis of the force field that particles propagate in all directions.
ParticleSystem.forceModuleForceX : PSCurve
Applies linear force along the local X-axis to particles within the force field volume.
ParticleSystem.forceModuleForceZ : PSCurve
Applies linear force along the local Z-axis to particles within the force field volume.
ParticleSystem.colorModuleEnable : boolean
Whether to enable the color of the particle throughout its entire lifecycle.
ParticleSystem.colorModuleColor : PSGradient
The color gradient of the particle over its entire lifespan.
ParticleSystem.colorByVelocityModuleEnable : boolean
Whether the ColorByVelocityModule module is enabled.
ParticleSystem.rotationModuleSeparateAxes : boolean
Whether to independently control the rotation change with speed on the three axes (X, Y, Z) of the particles.
ParticleSystem.colorByVelocityModuleSpeedRange : Vector2
Applies a color gradient between the minimum and maximum speeds.
ParticleSystem.colorByVelocityModuleColor : PSGradient
The minimum and maximum color gradient for the ColorByVelocity module.
ParticleSystem.sizeModuleEnable : boolean
Whether the SizeModule is enabled.
ParticleSystem.sizeModuleSeparateAxes : boolean
Whether to enable size over the entire lifetime on each axis.
ParticleSystem.sizeModuleSizeX : PSCurve
The size of the x-axis varies with the lifetime curve.
ParticleSystem.sizeModuleSizeY : PSCurve
The size curve of the y-axis over the lifetime.
ParticleSystem.sizeModuleSizeZ : PSCurve
The size over lifetime curve of the z-axis.
ParticleSystem.sizeByVelocityModuleEnable : boolean
Whether to enable the SizeByVelocityModule.
ParticleSystem.sizeByVelocityModuleSeparateAxes : boolean
Whether to set the size based on velocity for each axis separately.
ParticleSystem.sizeByVelocityModuleSizeX : PSCurve
The curve that calculates the size based on the velocity along the x-axis.
ParticleSystem.sizeByVelocityModuleSizeY : PSCurve
The curve that calculates the size of the Y-axis based on velocity.
ParticleSystem.sizeByVelocityModuleSizeZ : PSCurve
The curve that calculates the size based on the velocity along the z-axis.
ParticleSystem.rotationModuleEnable : boolean
Whether the rotation module is enabled.
ParticleSystem.rotationModuleAngularVelocityZ : PSCurve
Angular velocity of rotation around the z-axis.
ParticleSystem.rotationByVelocityModuleEnable : boolean
Whether the rotation speed module is enabled.
ParticleSystem.rotationByVelocityModuleSeparateAxes : boolean
Rotates the velocity on each axis.
ParticleSystem.rotationByVelocityModuleSpeedRange : Vector2
The minimum and maximum speed between rotation curves.
ParticleSystem.rotationByVelocityModuleAngularVelocityX : PSCurve
Angular velocity of rotation around the X-axis.
ParticleSystem.rotationByVelocityModuleAngularVelocityY : PSCurve
Angular velocity of rotation around the Y-axis.
ParticleSystem.rotationByVelocityModuleAngularVelocityZ : PSCurve
Angular velocity of rotation around the Y-axis.
ParticleSystem.renderModuleEnable : boolean
Whether the rendering module of the particle system is enabled.
ParticleSystem.renderModuleRenderMode : PSRenderMode
The rendering mode of the particle system.
ParticleSystem.renderModuleRenderSpace : PSRenderSpace
The rendering space of the particle system.
ParticleSystem.renderModuleMaxParticleSize : number
The maximum size of the particle.
ParticleSystem.renderModuleMinParticleSize : number
The minimum size of the particle.
ParticleSystem.renderModuleVelocityScale : number
The number of particles stretched based on their direction.
ParticleSystem.renderModuleLengthScale : number
The value of stretching the particle in the direction of motion of the emitter, defined as the ratio of the length of the particle to its width.
ParticleSystem.renderModuleNormalDirection : number
The normal direction of the particle.
ParticleSystem.renderModuleFlip : Vector3
Percentage of particles flipped around each axis.
ParticleSystem.renderModuleAllowRoll : boolean
Whether to allow particles or billboards to rotate around the Z-axis of the emitter.

成员方法

ParticleSystem.Play ( ) : void
Play particles.
ParticleSystem.Pause ( ) : void
Pauses the particle system.
ParticleSystem.Stop ( value : PSStopBehavior? ) : void
Stops the playback of the particle system using the provided stop behavior.