﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class gereCamera : MonoBehaviour {

	public Camera camEgo, camExo, mainCam; 
	public Camera[] camera;
	int currentCam; 

	// Use this for initialization
	void Start () {
		currentCam = 0; 
		camera [0] = camEgo;
		camera [1] = camExo; 
		camera [2] = mainCam; 
		camera [currentCam].gameObject.SetActive (true); 
		for (int i = 1; i < 3; i++) {
			camera [i].gameObject.SetActive (false); 
		}

	}
	
	// Update is called once per frame
	void Update () {


		if (Input.GetKeyUp(KeyCode.K)) {
			
			currentCam++; 

			Debug.Log ("currentgcam value :" + currentCam.ToString()); 

			if (currentCam < camera.Length) {
				camera [currentCam - 1].gameObject.SetActive (false);
				camera [currentCam].gameObject.SetActive (true); 
			} 

			else {
				camera [currentCam - 1].gameObject.SetActive (false);
				currentCam = 0;
				camera [currentCam].gameObject.SetActive (true);
			}

		}
		
	}
}
