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

function Start () {
	_count = 0;
}

function Update () {
	//Debug.Log("Panic Left: " + _count);
	if (_count > 0)
	{
		faceManager.SendMessage ("ActivatePanicLeft");
	}
	else
	{
		faceManager.SendMessage ("DeactivatePanicLeft");
	}
	_count = 0;
}

function OnTriggerStay(other: Collider)
{
	if (other != null)
	{
		if (other.CompareTag("Track"))
		{
			++ _count;
		}
	}
}
/*
function OnTriggerEnter(collider: Collider)
{
	++_count;
	Debug.Log("Left Panic Triggered: " + _count);
	faceManager.SendMessage ("ActivatePanicLeft");
}

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