Click on object to change camera?

So in my game, I want to be able to click on a object to change to a camera. However, I can’t figure out how to make it so I have to click on that object, and not just press the mouse button. Here is my script…

var camera1 : Camera;
var camera2 : Camera;

function Start(){
camera1.enabled = true;
camera2.enabled = false;
}

function Update(){

if(Input.GetButtonDown("Fire1")){
    if(camera1.enabled == true){
        camera1.enabled = false;
        camera2.enabled = true;
    }
    else{
        camera1.enabled = true;
        camera2.enabled = false;
    }
}

}

Remove your Update() function and replace it with this:

function OnMouseDown() {
    camera1.enabled = !camera1.enabled;
    camera2.enabled = !camera2.enabled;
}