ParticleSystem

class in UnityEngine

/

다음으로부터 상속:Component

매뉴얼로 전환

설명

Script interface for particle systems (Shuriken).

Shuriken is a powerful and versatile particle system component.

General parameters

The Particle System's general parameters are kept inside a special Main module. These parameters are visible in the Inspector above all the other modules:



In script, these parameters are accessible through ParticleSystem.main.

Module effect multipliers

Every module has special multiplier properties that allow you to change the overall effect of a curve without having to edit the curve itself. These multiplier properties are all named after the curve they affect - for instance ParticleSystem.emission.rateMultiplier controls the overall effect of ParticleSystem.emission.rate in a given system.

Constant value shorthand

Parameters support a shorthand notation for simple constant values. To set a constant value for a parameter, all you need to do is assign a number to it. It is not necessary to create a MinMaxCurve or MinMaxGradient object in the ParticleSystemCurveMode.Constant mode.

For example, instead of:
ParticleSystem.emission.rate = new ParticleSystem.MinMaxCurve(5.0f);
write:
ParticleSystem.emission.rate = 5.0f;

Performance note: When setting properties on particle modules, the settings are passed immediately into native code. This gives the best performance. This means that setting properties on a module struct doesn't set something in script that requires setting back to the particle system; it all happens automatically.

See Also: Particle.

변수

automaticCullingEnabledDoes this system support Automatic Culling?
collisionAccess the particle system collision module.
colorBySpeedAccess the particle system color by lifetime module.
colorOverLifetimeAccess the particle system color over lifetime module.
customDataAccess the particle system Custom Data module.
emissionAccess the particle system emission module.
externalForcesAccess the particle system external forces module.
forceOverLifetimeAccess the particle system force over lifetime module.
inheritVelocityAccess the particle system velocity inheritance module.
isEmittingIs the Particle System currently emitting particles? A Particle System may stop emitting when its emission module has finished, it has been paused or if the system has been stopped using Stop with the StopEmitting flag. Resume emitting by calling Play.
isPausedIs the Particle System paused right now?
isPlayingIs the Particle System playing right now?
isStoppedIs the Particle System stopped right now?
lightsAccess the particle system lights module.
limitVelocityOverLifetimeAccess the particle system limit velocity over lifetime module.
mainAccess the main particle system settings.
noiseAccess the particle system noise module.
particleCountThe current number of particles (Read Only).
randomSeedOverride the random seed used for the particle system emission.
rotationBySpeedAccess the particle system rotation by speed module.
rotationOverLifetimeAccess the particle system rotation over lifetime module.
shapeAccess the particle system shape module.
sizeBySpeedAccess the particle system size by speed module.
sizeOverLifetimeAccess the particle system size over lifetime module.
subEmittersAccess the particle system sub emitters module.
textureSheetAnimationAccess the particle system texture sheet animation module.
timePlayback position in seconds.
trailsAccess the particle system trails module.
triggerAccess the particle system trigger module.
useAutoRandomSeedControls whether the Particle System uses an automatically-generated random number to seed the random number generator.
velocityOverLifetimeAccess the particle system velocity over lifetime module.

Public 함수

ClearRemove all particles in the particle system.
EmitEmit count particles immediately.
GetCustomParticleDataGet a stream of custom per-particle data.
GetParticlesGets the particles of this particle system.
IsAliveDoes the system contain any live particles, or will it produce more?
PausePauses the system so no new particles are emitted and the existing particles are not updated.
PlayStarts the particle system.
SetCustomParticleDataSet a stream of custom per-particle data.
SetParticlesSets the particles of this particle system.
SimulateFastforwards the particle system by simulating particles over given period of time, then pauses it.
StopStops playing the particle system using the supplied stop behaviour.
TriggerSubEmitterTriggers the specified sub emitter on all particles of the Particle System.

상속된 멤버

변수

gameObjectThe game object this component is attached to. A component is always attached to a game object.
tagThe tag of this game object.
transformThe Transform attached to this GameObject.
hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameThe name of the object.

Public 함수

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 GameObject.

정적 함수

DestroyRemoves a gameobject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object 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.

연산자

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