private void ConvertPrimaryClicked(Vector2 location)
 {
     // Convert from screen space to world space.
     if (IsEnabled)
     {
         inDrag = true;
         PrimaryPressed?.Invoke(camera.ScreenToWorldPoint(location));
     }
 }
Beispiel #2
0
 private void OnUpdateToStart()
 {
     // Move the cursor towards the cursor action start point.
     if (MoveCursorTowards(currentAction.path[0]))
     {
         if (currentAction.holdsClick)
         {
             // Simulate mouse click.
             PrimaryPressed?.Invoke(currentAction.path[0]);
             // Update state (for interruptor method).
             actionState = ActionState.DraggingTowardsEnd;
         }
         else
         {
             actionState = ActionState.MovingTowardsEnd;
         }
         // Change routine.
         UpdateContext.Update -= OnUpdateToStart;
         UpdateContext.Update += OnUpdateAlong;
     }
 }