function Start ()
{
if (!target)
target = GameObject.FindWithTag("Player").transform;
// Rather than placing this in an update function, we can start the AI's behavior now and
//use coroutines to handle the changes
yield WaitForSeconds(idleTime);
while (true)
{
// Idle around and wait for the player
yield Idle();
// Player has been located, prepare for the attack.
yield Attack();
}
}