public var targetTileName = "";
private var originalColor; // save the original color
private var tileGameObject; // save the tile object

// start is called at the beginning of the game, before any updates() start happening
function Start() {
    tileGameObject = GameObject.Find(targetTileName);
	originalColor = tileGameObject.renderer.material.color;
	GameObject.Find("MessageCamera").GetComponent("Camera").enabled = false;
	GameObject.Find("Main Camera").GetComponent("Camera").enabled = true;
}

function OnTriggerEnter (other : Collider) {
	if (other.name == "PlayerPiece") {
		timerGameObject = GameObject.Find("TimerText");
		trackTimeComponent = timerGameObject.GetComponent("TrackTime");
		trackTimeComponent.timerOn = false;
		GameObject.Find("Main Camera").GetComponent("Camera").enabled = false;
		GameObject.Find("MessageCamera").GetComponent("Camera").enabled = true;
	}
}

function OnTriggerStay (other : Collider) {
	tileGameObject.renderer.material.color = Color.green;
}

function OnTriggerExit( other : Collider ) {
	tileGameObject.renderer.material.color = originalColor;
}
