SetActive - setactive(true) for one object, setactive(false) to the rest

Hey i have a GameObject array full of cameras. These are linked to different enums which are operated with a switch state.

switch (state)
        {
            case State.Player1:
                SwitchCameras();
                cameras[1].SetActive(true);
                break;
            case State.Player2:
                SwitchCameras();
                cameras[2].SetActive(true);
                break;
            case State.none:
                SwitchCameras();
                cameras[3].SetActive(true);
                break;
        }

What i want to do is when one of the camera = true, then the other cameras = false.
And this i want to control with the SwitchCameras function:

void SwitchCameras(){
        for (int i = 0; i < cameras.Length; i++){
           //stuff
        }
    }

The foor loop will check through all cameras. The question here is how it can see a gameobject that is active, and then know to disable the others. And then when a before false camera becomes true the others become false again.

Thanks

What you want to do is when one of the cameras is activated you will want to pass a reference of that camera component then check the array for all cameras that are not the same so something like

private Camera[] allCams;

void SwitchCamera (Camera activatedCam){
    for(int i = 0; i < allCams.length; i++){
        if(!allCams*.Equals(activatedCam)){*

allCams*.enabled = false;*
} else {
allCams*.enabled = true;*
}
}
}