Game Development Reference
In-Depth Information
{
state = "SHOOTING";
animation.CrossFade("shoot");
speed = 0.00;
Shoot();
}
else
{
state = "PURSUE";
animation.CrossFade("run");
speed = 0.08;
Pursue();
}
}
else
{
state = "PATROL";
if (!animation.IsPlaying("idle"))
{
animation.Play ("idle");
speed = 0.00;
}
Patrol();
}
}
function Patrol ()
{
//stand around
}
function CanSeeTarget () : boolean
{
if (Vector3.Distance(transform.position, target.
position) > seeRange)
return false;
return true;
}
function CanShoot(): boolean
{
if (Vector3.Distance(transform.position, target.
position) > shootRange)
return false;
return true;
}
function Pursue()
{
Search Nedrilad ::




Custom Search