Advertisement
Guest User

Untitled

a guest
Jul 24th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.36 KB | None | 0 0
  1.         if(Input.GetMouseButtonDown(0)) //if mouse 1 pressed, begin selection box
  2.         {
  3.             selecting = true;
  4.             mousePosition1 = Input.mousePosition;
  5.         }
  6.         if(Input.GetMouseButtonUp(0))
  7.         {
  8.             selecting = false;
  9.  
  10.             // Dragging selection.
  11.             if(Vector2.Distance(Input.mousePosition, mousePosition1) > 2f)
  12.                 CheckForUnits ();
  13.             else
  14.                 ClickSelection ();
  15.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement