private void ClearSelection() { SplineEditorCache.RigisterUndo("Edit Selection"); SplineEditorCache.ClearSelection(); GUI.changed = true; }
private void RegisterUndoOnSliderChangedOnce() { Debug.Assert(GUIUtility.hotControl != 0); if (m_SliderChanged == false) { m_SliderChanged = true; RegisterUndo(); SplineEditorCache.RigisterUndo(); } }
private void SelectionChanged() { if (target == null) { return; } if (target != SplineEditorCache.GetTarget()) { SplineEditorCache.RigisterUndo(); } InvalidateShapeEditor(); }
private void DoRectSelectionGUI() { Debug.Assert(m_Spline != null); var selection = SplineEditorCache.GetSelection(); if (m_RectSelectionID == -1) { m_RectSelectionID = GUIUtility.GetControlID("RectSelection".GetHashCode(), FocusType.Passive); } if (Event.current.GetTypeForControl(m_RectSelectionID) == EventType.MouseDown && Event.current.button == 0) { if (!Event.current.shift && !EditorGUI.actionKey) { SplineEditorCache.RigisterUndo("Edit Selection"); SplineEditorCache.ClearSelection(); GUI.changed = true; } } if (Event.current.GetTypeForControl(m_RectSelectionID) == EventType.MouseUp && Event.current.button == 0) { SplineEditorCache.RigisterUndo("Edit Selection"); selection.EndSelection(true); GUI.changed = true; } EditorGUI.BeginChangeCheck(); var selectionRect = m_RectSelectionTool.Do(m_RectSelectionID, GetTransform().position); if (EditorGUI.EndChangeCheck()) { selection.BeginSelection(); for (int i = 0; i < m_Spline.GetPointCount(); ++i) { if (selectionRect.Contains(HandleUtility.WorldToGUIPoint(LocalToWorld(m_Spline.GetPosition(i))), true)) { selection.Select(i, true); } } } }
private void SelectPoint(int index) { ISelection selection = SplineEditorCache.GetSelection(); bool additive = currentEvent.shift; bool subtractive = EditorGUI.actionKey; SplineEditorCache.RigisterUndo("Edit Selection"); if (!additive && !subtractive) { SplineEditorCache.ClearSelection(); } selection.Select(index, (!selection.IsSelected(index) || additive) && !subtractive); GUI.changed = true; }