Hi Naumaan,
What exactly do you mean? Whenever the OnFire method gets called, you could either enable or disable the laser. If you reference the laser game object, you could call laser.SetActive(true); or lasers.SetActive(false); on the laser game object. Enabling and disabling works the same way as in Rick’s code.
I hope this helped. 
See also:
- Forum User Guides : How to mark a topic as solved