Arrow keys affect only enabled camera?

Hello everyone.

I've a question to ask; I've scripted my main camera to be able to look up/down/left/right, and here's the code for it.

var speed : float = 25;
var x : float = 0;
var y : float = 0;
var z : float = 0;
x=transform.eulerAngles.y;

function Update() 
{
    x+= Input.GetAxis("Horizontal")*speed*Time.deltaTime;
    y+= Input.GetAxis("Vertical")*speed*Time.deltaTime;
    transform.rotation=Quaternion.Euler(y,x,z);
}

It works perfectly, but now I've to add another camera into the scene that has the same capabilities, then the question comes in:

What can I do to make the arrow keys affect the enabled camera only?

Thanks for the help. =)

I don't know if I'm missing something here, but first thing that came to mind, why not just check if the GameObject with this script attached is currently enabled?

Assuming you explicitly set your camera's states to enabled/disabled.

function Update() 
{
    if (enabled == true)
    {
       x+= Input.GetAxis("Horizontal")*speed*Time.deltaTime;
       y+= Input.GetAxis("Vertical")*speed*Time.deltaTime;
       transform.rotation=Quaternion.Euler(y,x,z);
    }
}

Ok I found the solution! Very big thanks to Keith =)

I basically add in another variable for a camera, and in the if statement, add in that variable.

var camcam : Camera;
function Update() 
    {
        if (camcam.enabled == true)
        {
           x+= Input.GetAxis("Horizontal")*speed*Time.deltaTime;
           y+= Input.GetAxis("Vertical")*speed*Time.deltaTime;
           transform.rotation=Quaternion.Euler(y,x,z);
        }
    }

Once again, thanks Keith for suggesting the if idea. =)