private void ConvertPrimaryReleased(Vector2 location)
 {
     // Convert from screen space to world space.
     if (IsEnabled)
     {
         inDrag = false;
         PrimaryReleased?.Invoke(camera.ScreenToWorldPoint(location));
     }
 }
예제 #2
0
 private void OnUpdateAlong()
 {
     // Move the cursor towards the next point on the path.
     if (MoveCursorTowards(currentAction.path[pathIndex]))
     {
         // Check if the end point has been reached.
         if (pathIndex == currentAction.path.Length - 1)
         {
             if (currentAction.holdsClick)
             {
                 // Simulate mouse release.
                 PrimaryReleased?.Invoke(currentAction.path[pathIndex]);
             }
             // Change routine.
             UpdateContext.Update -= OnUpdateAlong;
             PullAction();
         }
         else
         {
             pathIndex++;
         }
     }
 }