// Use this for initialization
void OnEnable()
{
agent = GetComponent<NavMeshAgent> ();
hunting = false;
huntTimer = 0;
if (Random.value < 0.5f) {
currentDestination = Random.Range (0, destinations.Length - 1);
agent.SetDestination (destinations [currentDestination].transform.position);
} else {
hunting = true;
agent.SetDestination (targetPlayer.transform.position);
currentDestination = Random.Range (0, destinations.Length - 1);
}
}