code to play my animation on button press, but it is looping. What do I add to stop this?

I’ve got a gun in my game to fire, and I’ve just created the animation for it. I setted up a code so that when I pressed down “fire” (LMB) that the animation would play. How ever it keeps on looping after I pressed it, which obviously is unideal. Here is the code (using Java)

var animation_bool : boolean ;

  function Update()
                 {

      if(animation_bool == true)
                 {
             animation.Play("backfire");

                 }

      if(Input.GetButtonDown("fire"))
                 {
          animation_bool = true;

                
          }       
                
         }

Check this,

http://answers.unity3d.com/questions/45070/play-animation-only-once.html?sort=oldest

“Just use animation.Play() or animation.CrossFade() as usual but first set the wrapmode of your clip to WrapMode.Once. If you set the wrapmode in the inspector to “once” you don’t need the first line.”

animation["AnimationName"].wrapMode = WrapMode.Once;
animation.Play("AnimationName");