Particle emission to increase/decrease with keypress?

Hey guys, Am new to Unity and was wondering if anyone could offer me some help? There is two things I need help with, the first is;

a) Scripting a particle system so that emissions increase on a keypress, or decrease if another key is pressed.

b) Representing on a slider or bar how far the particles have been increased or decreased.

If b) is a bit complex its just a) that I need the most help on. Please if anyone could help, this would be so appreciated.

Regards

ParticleEmitter.minEmission and ParticleEmitter.maxEmission represent the minimum and maximum number of particles that will be spawned by a particle emitter every second, respectively. Their value is a float representing particles spawned per second.

Knowing that, I might write something like this (in friendly Unityscript):

var myEmitter : ParticleEmitter;
var myEmission : float = 0.0;
function Start() {
   myEmission =  myEmitter.minEmission;
}
function Update () {
    if (Input.GetKeyDown (KeyCode.UpArrow)) {
        myEmission += 1.0;
    }
   if (Input.GetKeyDown (KeyCode.DownArrow)) {
        myEmission -= 1.0;
   }
   myEmitter.minEmission = myEmission;
   myEmitter.maxEmission = myEmission;
}

You could attach this to any Game Object. You would drag your emitter onto “My Emitter” in the inspector. The idea is that you set the emission value based on the inputs. You wouldn’t need to set minEmission and maxEmission in every update – that is probably a bad idea, but I wanted to illustrate the general idea quickly.

For the bar, look at examples on the forum for how things like health bars are shown – this script exposed a floating point value that would work just like a health bar.

Thank you very much for your help, I will try to make this work now based on your comments and come back with any success. Cheers