Is it possible to have an array of cameras, that when a button is pressed it will go to the next camera? I have code that works for switching between 2 cameras but i want to add another 1 or maybe 2 and having them in an array would look better I think. The code I have for switching between my 2 cameras is:
public Camera thirdPersonCamera;
public Camera topDownCamera;
// Use this for initialization
void Start () {
thirdPersonCamera.camera.enabled = true;
topDownCamera.camera.enabled = false;
}
// Update is called once per frame
void Update () {
if(Input.GetKey (KeyCode.F1)){
thirdPersonCamera.camera.enabled = true;
topDownCamera.camera.enabled = false;
}
if(Input.GetKey(KeyCode.F2)){
thirdPersonCamera.camera.enabled = false;
topDownCamera.camera.enabled = true;
}
}
Thanks for any help