CameraBox.Update C# (CSharp) Method

Update() public method

Detects when player presses the K key and switches the camera.
public Update ( ) : void
return void
    void Update ()
    {
	    if (Input.GetKeyDown(KeyCode.K))
        {
            if (cams.Length > 1)
            {
                cams[currentIndex].enabled = false;
                if (currentIndex == cams.Length - 1)
                {
                    currentIndex = 0;
                }
                else
                {
                    currentIndex = currentIndex + 1;
                }
                cams[currentIndex].enabled = true;
            }
        }
	}
}