Particle System / Getting Started

The particle system can be found in the Assets/Playniax/Framework/Particle System folder.

You can create particles by adding the Particle script to a GameObject, create a particle from a script or you can use the emitter to create particle effects.

The particle system only supports GameObjects with a SpriteRenderer (sprites).

Particle

To create a particle simply create a sprite and add the Particle component to it.

GameObject with Particle script:



Example scene can be found in Assets/Playniax/Framework/Particle System/Examples/Example 01 - Particle.unity

Emitter

The Emitter can be used to create a single particle effect or multiple emitters can be used when you need complex effects.

To create an emitter simply create a GameObject and add one or multiple Emitter components to it.

GameObject with Emitter script:



The Test button at the bottom of an emitter is very important.

The Test button can be used to test your effect.

This works in edit mode and at runtime.

Example scene can be found in Assets/Playniax/Framework/Particle System/Examples/Example 02 - Emitter.unity

Emitter Group

EmitterGroup can be used to play multiple emitters on the condition that the emitters are part of the same GameObject or are children of the same GameObject.

GameObject with EmitterGroup script:



Note that the emitter group also has a Test button.

Example scene can be found in Assets/Playniax/Framework/Particle System/Examples/Example 03 - Emitter Group.unity

Emitter Player

Particle effects created with emitters don't play by them selfs.

They only play when you press the Test button, by executing them from a script or by using the EmitterPlayer

EmitterPlayer does not work in edit mode but only at runtime.

EmitterPlayer needs the Emitter or EmitterGroup id to know what to play.

Example scene can be found in Assets/Playniax/Framework/Particle System/Examples/Example 04 - Emitter Player.unity

Execute from script

Particle effects can be executed from script.

You can execute a single emitter with the Play command:
Emitter.Play(id, position, parent, scale, orderInLayer, timeScale);
To execute a more complex effect the emitter group Play command can be used:
EmitterGroup.Call(id, position, parent, scale, orderInLayer, timeScale);
Important - the particle effects have to be in your scene or you can't execute them.