Exemplo n.º 1
0
 private void UpdateInput()
 {
     // The input supports both dragging from one tile to another and clicking on each separately.
     // A click only registers if the player releases their finger/mouse button while still over the tile they pressed it down on
     // otherwise it counts as a drag and will attempt to join the first piece with whatever they're pointing at now.
     // dragging into nothing clears the original selection.
     if (Input.GetMouseButtonDown(0))
     {
         AttemptToClick();
     }
     if (Input.GetMouseButton(0))
     {
         if (firstHitTile != null)
         {
             MoveDragLine();
         }
     }
     if (Input.GetMouseButtonUp(0))
     {
         if (firstHitTile != null)
         {
             effects.ClearDragLine();
             AttemptToClick();
         }
     }
 }