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