Beispiel #1
0
 public void HandleMoveRequest(Vector2Int targetCell, UnityAction onArrive = null, OnBlockedAction onBlocked = null)
 {
     StopAllRequests();
     if (navAgent.SetDestination(targetCell))
     {
         onArriveAction  = onArrive;
         onBlockedAction = onBlocked;
         isMoving        = true;
         unitIsBlocked   = false;
         hasNextPosition = false;
     }
     else
     {
         navAgent.ClearPath();
     }
 }