This method can be called from anywhere using the usual "UnityGUI" style,
where you need to keep state in your own classes.
Namespace: NarayanaGames.Common.UIAssembly: Assembly-CSharp-firstpass (in Assembly-CSharp-firstpass.dll) Version: 0.0.0.0
Syntax
Parameters
- lastMousePos
- Type: Vector2
the last mouse position
- position
- Type: Rect
the current position of the drag button
- maxPosition
- Type: Vector2
the maximum position on screen for dragging
- isDragging
- Type: System Boolean
are we currently in a dragging operation
- icon
- Type: Texture
icon on the button
Return Value
the offset from the dragging operation - up to you to handle appropriately ;-)See Also