Graphics Reference
In-Depth Information
}
}
public virtual void TurnLeft ()
{
horz= -1;
}
public virtual void TurnRight ()
{
horz= 1;
}
public virtual void MoveForward ()
{
vert= 1;
}
public virtual void MoveBack ()
{
vert= -1;
}
public virtual void NoMove ()
{
vert= 0;
}
public virtual void LookAroundFor(Transform aTransform)
{
// here we do a quick check to test the distance between AI
// and target. If it's higher than our maxChaseDistance
// variable, we drop out of chase mode and go back to
// patrolling.
if( Vector3.Distance( myTransform.position, aTransform.
position ) < maxChaseDistance )
{
// check to see if the target is visible before
// going into chase mode
if( CanSee( followTarget )==true )
{
// set our state to chase the target
SetAIState( AIState.chasing_target );
}
}
}
private int obstacleFinding;
public virtual int IsObstacleAhead()
{
obstacleHitType=0;
// quick check to make sure that myTransform has been set
if( myTransform==null )
{
return 0;
}
Search WWH ::




Custom Search