Particle emitter to emit "one-shot" on specific occasions

Hi. Question is simple... I have a cannon... when it goes boom, particles are emmited once... once it goes boom again, particles are emmited once... so on... Problem is, when it goes boom for the first time, i turn the emitter on, and even thou I have "one shot" selected, it keeps emmiting particles.. Is there a "correct" way to solve it? I`ve read stuff about creating co-routines and stuff... no other way? thks.

"One-shot" doesn't mean the particles are emitted only one time, it means the particles are emitted all at once instead of over time. When all the particles run out of energy, they are emitted again, and will continue as long as the particle system is active and emit is set to true. What you're probably looking for is `particleEmitter.Emit()` (`particleEmitter.emit` should be false).

Are there any scripts attached to this cannon you speak of?

public class Cannon : MonoBehaviour {

    public static bool turnOnEmitter = false;

    private void Update() { BoomScript(); }

    private void BoomScript() {
        ParticleEmitter pEmitter = GetComponent<ParticleEmitter>( );
        if (turnOnEmitter) {pEmitter.emit = true;}
        else 
            pEmitter.emit = false;
   }
}

My solution to this problem was to create a prefab of a particle system; tick one-shot in the emitter and autodestruct on the animator. I then create an instance of that prefab when I want the smoke.
Before this I was trying to do a method like the other answers here - but was landlocked by yield not working! It would just never return… (in boo, not tried other langs recently)

My solution:

chozabu’s solution:
“Create a prefab of a particle system; tick one-shot in the emitter and autodestruct on the animator. I then create an instance of that prefab when I want the smoke.”

plus

Set Min Energy in the emitter to Zero.

I used one of the supplied emitters prefabs. “sparks”. I edited it to look like blood splatter then had the same problem discussed here. I opened the animation window and did 2 animations . the first the emitter is on and goes off after 1.5 seconds. The second animation is just dead 10 frames with the emitter off. In the animator window I have NewState as the default that transitions to my first animation on exit time ( which is immediate) and that - on exit time transitions to my second dead animation and there it just loops invisibly. So each time I shoot flesh and the blood splatter instantiates it plays those the first animation transitioning to the second animation where it remains off until the prefab times out