Continuous Shoothing

Hi guys, I’m Italian then I apologize for some grammatical errors…

I’ve this script:

#pragma strict

var muzzleFlash : Renderer;
var muzzleLight : Light;





function Start () {

muzzleFlash.enabled = false;
muzzleLight.enabled = false;


}

function Update () {

if(Input.GetButtonDown("Fire1")){
Shoot();
}

}


function Shoot(){
muzzleFlash.renderer.enabled=true;
muzzleLight.enabled = true;
yield WaitForSeconds(0.02);
muzzleFlash.renderer.enabled = false;
muzzleLight.enabled = false;



}

I want the MuzzleFlash turns on and off when I hold down “Fire1”…

Thanks for the answers,

But… I might not have explained myself clearly

I want the flash is continuous when I hold the mouse button down

GetButton instead of GetButtonDown