using UnityEngine;
using System.Collections;

public class CabinLampScript : MonoBehaviour {

	private Light myLight;

	// Use this for initialization
	void Start () {
	
		myLight = gameObject.GetComponentInChildren<Light>();

		if(!myLight){
			Debug.LogError("CabinLamp:: cannot find my light!");
		}

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

	public void interactWithLamp(){

		//TODO: play switch sound

		if(myLight.enabled){
			myLight.enabled = false;
		}else{
			myLight.enabled = true;
		}

		audio.Play();

	}

}
