Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Rect GetCursorDrawPosition()
- {
- float leftPos = Mathf.Clamp(Input.mousePosition.x, 0, Screen.width-activeCursor.width/2);
- float topPos = Mathf.Clamp(Screen.height - Input.mousePosition.y, 0, Screen.height-activeCursor.height);
- if(activeCursorState == CursorState.Move || activeCursorState == CursorState.Select || activeCursorState == CursorState.Harvest)
- {
- topPos -= activeCursor.height / 2;
- leftPos -= activeCursor.width / 2;
- }
- return new Rect(leftPos, topPos, activeCursor.width, activeCursor.height);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement