Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(Input.GetMouseButtonDown(0)) //if mouse 1 pressed, begin selection box
- {
- selecting = true;
- mousePosition1 = Input.mousePosition;
- }
- if(Input.GetMouseButtonUp(0))
- {
- selecting = false;
- // Dragging selection.
- if(Vector2.Distance(Input.mousePosition, mousePosition1) > 2f)
- CheckForUnits ();
- else
- ClickSelection ();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement