#pragma strict
var faceManager : GameObject;
private var _count : int;

function Start () {
	_count = 0;
}

function Update () {
	//Debug.Log("Panic Right: " + _count);
	if (_count > 0)
	{
		faceManager.SendMessage ("ActivatePanicRight");

	}
	else
	{
		faceManager.SendMessage ("DeactivatePanicRight");
	}
	_count = 0;
}

function OnTriggerStay(other: Collider)
{
	if (other != null)
	{
		if (other.CompareTag("Track"))
		{
			++ _count;
		}
	}
}

/*
function OnTriggerEnter(collider: Collider)
{
	++_count;
	Debug.Log("Right Panic Triggered: " + _count);
	faceManager.SendMessage ("ActivatePanicRight");
}

function OnTriggerExit(other: Collider)
{
	--_count;
	Debug.Log("Right Panic Removed: " + _count);
	if (_count == 0)
	{
		faceManager.SendMessage ("DeactivatePanicRight");
	}
}
*/

