Version: 2023.1
LanguageEnglish
  • C#

MainModule

struct in UnityEngine

/

Implemented in:UnityEngine.ParticleSystemModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual

Description

Script interface for the MainModule of a Particle System.

Properties

cullingModeConfigure whether the Particle System will still be simulated each frame, when it is offscreen.
customSimulationSpaceSimulate particles relative to a custom transform component.
durationThe duration of the Particle System in seconds.
emitterVelocityThe current Particle System velocity.
emitterVelocityModeControl how the Particle System calculates its velocity, when moving in the world.
flipRotationMakes some particles spin in the opposite direction.
gravityModifierA scale that this Particle System applies to gravity, defined either by Physics.gravity or [Physics2D.gravity]].
gravityModifierMultiplierChange the gravity multiplier.
gravitySourceSpecify whether to use the gravity strength from the 2D or 3D physics system.
loopSpecifies whether the Particle System is looping.
maxParticlesThe maximum number of particles to emit.
playOnAwakeIf set to true, the Particle System automatically begins to play on startup.
prewarmIf ParticleSystem.MainModule.loop is true, when you enable this property, the Particle System looks like it has already simulated for one loop when first becoming visible.
ringBufferLoopRangeWhen ParticleSystem.MainModule.ringBufferMode is set to loop, this value defines the proportion of the particle life that loops.
ringBufferModeConfigure the Particle System to not kill its particles when their lifetimes are exceeded.
scalingModeControl how the Particle System applies its Transform component to the particles it emits.
simulationSpaceThis selects the space in which to simulate particles. It can be either world or local space.
simulationSpeedOverride the default playback speed of the Particle System.
startColorThe initial color of particles when the Particle System first spawns them.
startDelayStart delay in seconds.
startDelayMultiplierA multiplier for ParticleSystem.MainModule.startDelay in seconds.
startLifetimeThe total lifetime in seconds that each new particle has.
startLifetimeMultiplierA multiplier for ParticleSystem.MainModule.startLifetime.
startRotationThe initial rotation of particles when the Particle System first spawns them.
startRotation3DA flag to enable 3D particle rotation.
startRotationMultiplierA multiplier for ParticleSystem.MainModule.startRotation.
startRotationXThe initial rotation of particles around the x-axis when emitted.
startRotationXMultiplierThe initial rotation multiplier of particles around the x-axis when the Particle System first spawns them.
startRotationYThe initial rotation of particles around the y-axis when the Particle System first spawns them.
startRotationYMultiplierThe initial rotation multiplier of particles around the y-axis when the Particle System first spawns them..
startRotationZThe initial rotation of particles around the z-axis when the Particle System first spawns them
startRotationZMultiplierThe initial rotation multiplier of particles around the z-axis when the Particle System first spawns them.
startSizeThe initial size of particles when the Particle System first spawns them.
startSize3DA flag to enable specifying particle size individually for each axis.
startSizeMultiplierA multiplier for the initial size of particles when the Particle System first spawns them.
startSizeXThe initial size of particles along the x-axis when the Particle System first spawns them.
startSizeXMultiplierA multiplier for ParticleSystem.MainModule.startSizeX.
startSizeYThe initial size of particles along the y-axis when the Particle System first spawns them.
startSizeYMultiplierA multiplier for ParticleSystem.MainModule.startSizeY.
startSizeZThe initial size of particles along the z-axis when the Particle System first spawns them.
startSizeZMultiplierA multiplier for ParticleSystem.MainModule.startSizeZ.
startSpeedThe initial speed of particles when the Particle System first spawns them.
startSpeedMultiplierA multiplier for ParticleSystem.MainModule.startSpeed.
stopActionSelect whether to Disable or Destroy the GameObject, or to call the MonoBehaviour.OnParticleSystemStopped script Callback, when the Particle System stops and all particles have died.
useUnscaledTimeWhen true, use the unscaled delta time to simulate the Particle System. Otherwise, use the scaled delta time.