2 click - defferent actions

//Hello. i work in C# script!
using UnityEngine;
using System.Collections;

public class Torchelighte : MonoBehaviour {

	public float IntensityLight;

//if i press 1 time click the torch light up
if (Input.GetButtonDown ("Fire1")) {
	IntensityLight = 2;
}
//if i press 1 more time click the torch must don't light
if (Input.GetButtonDown ("Fire1") && IntensityLight == 2) {
	IntensityLight = 0;
}
}

what i can do to make this work perfectly. if i press 1 time click the torch don’t
light up…If i put first command the torch light up but when i put the second command the torch don’t light up… I need help fast. Thx.

I wouldn’t compare floats like that, you could use bool to trigger or enum states.

private bool lightOn = false;
public float intensity = 0;

if (Input.GetButtonDown("Fire1")){
    lightOn = !lightOn;

    if(lightOn) intensity = 2f;
    else intensity = 0f;
}