Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

ParticleSystem

Switch to Manual

Namespace: UnityEngine

/

Inherits from: Component

Description

Script interface for particle systems (Shuriken).

Variables

durationThe duration of the particle system in seconds (Read Only).
emissionRateThe rate of emission.
enableEmissionWhen set to false, the particle system will not emit particles.
gravityModifierScale being applied to the gravity defined by Physics.gravity.
isPausedIs the particle system paused right now ?
isPlayingIs the particle system playing right now ?
isStoppedIs the particle system stopped right now ?
loopIs the particle system looping?
maxParticlesThe maximum number of particles to emit.
particleCountThe current number of particles (Read Only).
playbackSpeedThe playback speed of the particle system. 1 is normal playback speed.
playOnAwakeIf set to true, the particle system will automatically start playing on startup.
randomSeedRandom seed used for the particle system emission. If set to 0, it will be assigned a random value on awake.
safeCollisionEventSizeSafe array size for use with ParticleSystem.GetCollisionEvents.
simulationSpaceThis selects the space in which to simulate particles. It can be either world or local space.
startColorThe initial color of particles when emitted.
startDelayStart delay in seconds.
startLifetimeThe total lifetime in seconds that particles will have when emitted. When using curves, this values acts as a scale on the curve. This value is set in the particle when it is create by the particle system.
startRotationThe initial rotation of particles when emitted. When using curves, this values acts as a scale on the curve.
startSizeThe initial size of particles when emitted. When using curves, this values acts as a scale on the curve.
startSpeedThe initial speed of particles when emitted. When using curves, this values acts as a scale on the curve.
timePlayback position in seconds.

Functions

ClearRemove all particles in the particle system.
EmitEmit count particles immediately.
GetCollisionEventsGet the particle collision events for a GameObject. Returns the number of events written to the array.
GetParticlesGet the particles of this particle system. Returns the number of particles written to the input particle array.
IsAliveDoes the system have any live particles (or will produce more)?
PausePauses playing the particle system.
PlayPlays the particle system.
SetParticlesSet the particles of this particle system. size is the number of particles that is set.
SimulateFastforwards the particle system by simulating particles over given period of time, then pauses it.
StopStops playing the particle system.

Inherited members

Variables

animationThe Animation attached to this GameObject (null if there is none attached).
audioThe AudioSource attached to this GameObject (null if there is none attached).
cameraThe Camera attached to this GameObject (null if there is none attached).
colliderThe Collider attached to this GameObject (null if there is none attached).
collider2DThe Collider2D component attached to the object.
constantForceThe ConstantForce attached to this GameObject (null if there is none attached).
gameObjectThe game object this component is attached to. A component is always attached to a game object.
guiTextThe GUIText attached to this GameObject (null if there is none attached).
guiTextureThe GUITexture attached to this GameObject (Read Only). (null if there is none attached).
hingeJointThe HingeJoint attached to this GameObject (null if there is none attached).
lightThe Light attached to this GameObject (null if there is none attached).
networkViewThe NetworkView attached to this GameObject (Read Only). (null if there is none attached).
particleEmitterThe ParticleEmitter attached to this GameObject (null if there is none attached).
particleSystemThe ParticleSystem attached to this GameObject (null if there is none attached).
rendererThe Renderer attached to this GameObject (null if there is none attached).
rigidbodyThe Rigidbody attached to this GameObject (null if there is none attached).
rigidbody2DThe Rigidbody2D that is attached to the Component's GameObject.
tagThe tag of this game object.
transformThe Transform attached to this GameObject (null if there is none attached).
hideFlagsShould the object be hidden, saved with the scene or modifiable by the user?
nameThe name of the object.

Functions

BroadcastMessageCalls the method named methodName on every MonoBehaviour in this game object or any of its children.
CompareTagIs this game object tagged with /tag/?
GetComponentReturns the component of Type type if the game object has one attached, null if it doesn't.
GetComponentInChildrenReturns the component of Type type in the GameObject or any of its children using depth first search.
GetComponentInParentReturns the component of Type type in the GameObject or any of its parents.
GetComponentsReturns all components of Type type in the GameObject.
GetComponentsInChildrenReturns all components of Type type in the GameObject or any of its children.
GetComponentsInParentReturns all components of Type type in the GameObject or any of its parents.
SendMessageCalls the method named methodName on every MonoBehaviour in this game object.
SendMessageUpwardsCalls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.
GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the game object.

Static Functions

DestroyRemoves a gameobject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadMakes the object target not be destroyed automatically when loading a new scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeReturns a list of all active loaded objects of Type type.
InstantiateClones the object original and returns the clone.

Operators

boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares if two objects refer to the same.