示例#1
0
 protected void TryToMove()
 {
     if (!isWaiting || isForcedMovement)
     {
         if (isMoving)
         {
             LerpToDestination();
         }
         else
         {
             Movement next = movingEntity.NextMovement();
             if (movingEntity.Move())
             {
                 Move(next);
                 lastDirectionFaced = next == Movement.WAIT ? lastDirectionFaced : next;
             }
             else
             {
                 Move(Movement.WAIT);
             }
             setAnimatorState(next);
         }
     }
 }