using UnityEngine;
using System.Collections;

public enum CameraState {FPS, Overview};

public class CameraManager : MonoBehaviour {

	public Camera FPSCamera;
	public Camera OverviewCamera;
	public Light pointLight;



	CameraState CurState = CameraState.FPS;

	//float ftLastTimePushed = 0;
	//float ftTimeBetweenPush = 0.5f;
	// Use this for initialization
	void Start () {
		if (FPSCamera.enabled == true)
			CurState = CameraState.FPS;
		else
			CurState = CameraState.Overview;
	}
	// Update is called once per frame
	void Update () {
		/*
		if (InputWrapper.GetKey (MovementKeys.CameraSwitch) && (Time.time - ftLastTimePushed) > ftTimeBetweenPush) {
			if(FPSCamera.enabled == true){
				FPSCamera.enabled = false;
				OverviewCamera.enabled = true;
			}
			else{
				FPSCamera.enabled = true;
				OverviewCamera.enabled = true;
			}
			ftLastTimePushed = Time.time;
		}
		*/
	}

	public CameraState GetCameraState(){
		return CurState;
	}

	public void SwitchToOverview(){
		CurState = CameraState.Overview;
		FPSCamera.enabled = false;
		OverviewCamera.enabled = true;
		pointLight.range = 10;
		pointLight.enabled = true;
	}
	
	public void SwitchToFPS(){
		CurState = CameraState.FPS;
		FPSCamera.enabled = true;
		OverviewCamera.enabled = false;
		pointLight.range = 0;
		pointLight.enabled = false;
	}
}
