示例#1
0
 void CompareDistanceToNode()
 {
     if (intersecting && !arrived)
     {
         if (Vector3.Distance(transform.position, TargetPosition) < nodeDistanceThreshold)
         {
             targetNode.ShowGuide(true);
             AquireDirection(targetNode);
             transform.position = TargetPosition;
             moveDirection      = DesiredDirection;
             arrived            = true;
             Debug.Log("We are at the node");
         }
     }
     if (arrived)
     {
         if (transform.position == TargetPosition)
         {
             AquireDirection(targetNode);
             moveDirection = DesiredDirection;
             Debug.Log("Getting new Direction");
         }
         else
         {
             targetNode.ShowGuide(false);
             arrived      = false;
             intersecting = false;
         }
     }
 }