using UnityEngine;
using System.Collections;

public class InteractableObjectScript : MonoBehaviour {

	private Color highlightColor;// = Color.red;

	private bool objectHighlighted = false;

	// TODO post compo: proper inheritance so each thing has states and appropriate strings for "open door" vs. "close door" etc.
	//private string interactionString;

	void Awake(){

		highlightColor.r = 1.0f;
		highlightColor.g = 1.0f;
		highlightColor.b = 0.8f;
		highlightColor.a = 1.0f;

	}

	// Use this for initialization
	void Start () {

	}

	// Update is called once per frame
	void Update () {
	
		if(objectHighlighted){

			Renderer[] childObjects = gameObject.GetComponentsInChildren<Renderer>();
			foreach (Renderer go in childObjects){
				go.material.color = highlightColor;
			}

			objectHighlighted = false;

		}else{

			Renderer[] childObjects = gameObject.GetComponentsInChildren<Renderer>();
			foreach (Renderer go in childObjects){
				go.material.color = Color.white;
			}

		}

	}

	public void highlightObject(){

		objectHighlighted = true;

	}

}
