Exemplo n.º 1
0
 void FixedUpdate()
 {
     if (destination != null)
     {
         //如果到达目的地
         if ((Vector2)destination.transform.position == (Vector2)transform.position)
         {
             destination = pathway.GetNextWayPoint(destination, loop);
             if (destination != null)
             {
                 navAgent.destination = destination.transform.position;
             }
         }
     }
 }