Loop Animation Help

Ive written this script which plays an animation when the left mouse button is clicked but it only plays the animation once, whereas I want it to loop over and over until the left mouse button has stopped being pressed, can anyone help?

function Update ()

{

if ( Input.GetButtonDown("Fire1") ) {

   transform.animation.Play("Shoot");

}

}

You need to change the way the animation wraps, possibly in the start function of the class.

animation.wrapMode["Shoot"] = WrapMode.Loop;

Then, you must tell it to Stop in GetButtonUp.