Example #1
0
 /// <summary>
 /// Starts a drag operation on a GUI element.
 /// </summary>
 /// <param name="editorWindow">Reference to the current editor drawing the GUI (used when a Repaint is needed)</param>
 /// <param name="draggableList">List containing the dragged item and all other relative draggable items</param>
 /// <param name="dragItem">Item being dragged</param>
 /// <param name="draggedItemIndex">DraggableList index of the item being dragged</param>
 /// <param name="optionalData">Optional data that can be retrieved via the <see cref="optionalDragData"/> static property</param>
 public static void StartDrag(EditorWindow editorWindow, IList draggableList, object dragItem, int draggedItemIndex, object optionalData = null)
 {
     if (_dragData != null) return;
     Reset();
     _editor = null;
     _editorWindow = editorWindow;
     _dragData = new GUIDragData(draggableList, dragItem, draggedItemIndex, optionalData);
 }
Example #2
0
 static void Reset()
 {
     _dragData = null;
     _waitingToApplyDrag = false;
 }