static private ScaleSlider ( Vector2 pos, MouseCursor cursor, |
||
pos | Vector2 | |
cursor | MouseCursor | |
cursorRect | ||
Результат | Vector2 |
internal static Vector2 PointSlider(Vector2 pos, MouseCursor cursor, GUIStyle dragDot, GUIStyle dragDotActive) { int controlId = GUIUtility.GetControlID("Slider1D".GetHashCode(), FocusType.Keyboard); Vector2 vector2 = (Vector2)Handles.matrix.MultiplyPoint((Vector3)pos); Rect rect = new Rect(vector2.x - dragDot.fixedWidth * 0.5f, vector2.y - dragDot.fixedHeight * 0.5f, dragDot.fixedWidth, dragDot.fixedHeight); if (Event.current.GetTypeForControl(controlId) == EventType.Repaint) { if (GUIUtility.hotControl == controlId) { dragDotActive.Draw(rect, GUIContent.none, controlId); } else { dragDot.Draw(rect, GUIContent.none, controlId); } } return(SpriteEditorHandles.ScaleSlider(pos, cursor, rect)); }
internal static Vector2 ScaleSlider(Vector2 pos, MouseCursor cursor, Rect cursorRect) { int controlID = GUIUtility.GetControlID("Slider1D".GetHashCode(), FocusType.Keyboard); return(SpriteEditorHandles.ScaleSlider(controlID, pos, cursor, cursorRect)); }