using UnityEngine;
using System.Collections;

public class exitdoorInteraction: MonoBehaviour {
	public Camera mainCamera;
	public Camera exitdoorCamera;
	public int ActiveCam = 0;
	public GameObject player;

	// Use this for initialization
	void Start () {
		player = GameObject.Find ("Chef!");
	}

	void OnMouseDown ()
	{
		switch (ActiveCam) {
				case 0:
			Debug.Log ("Main Camera Deactivated");
			if (ActiveCam == 0)
			{
					ActiveCam = 1;
						mainCamera.enabled = !mainCamera.enabled;
				exitdoorCamera.enabled = true;
				player.renderer.enabled = false;
			if(player.GetComponent<CharacterMotor>())
			{
				player.GetComponent<CharacterMotor>().enabled = false;
			}
			}
						break;
				case 1:
			Debug.Log ("Sink Camera Deactivated");
			if (ActiveCam == 1)
			{
			ActiveCam = 0;
				exitdoorCamera.enabled = !exitdoorCamera.enabled;
						mainCamera.enabled = true;
				player.renderer.enabled = true;
						if(player.GetComponent<CharacterMotor>())
			{
				player.GetComponent<CharacterMotor>().enabled = true;
			}
			}
			break;
				}
	}
}