コード例 #1
0
 static void Reset()
 {
     _dragData           = null;
     _dragId             = -1;
     _waitingToApplyDrag = false;
     _dragDelayElapsed   = false;
     ClearDragDelayedCall();
 }
コード例 #2
0
 /// <summary>
 /// Starts a drag operation on a GUI element.
 /// </summary>
 /// <param name="dragId">ID for this drag operation (must be the same for both StartDrag and Drag</param>
 /// <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="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(int dragId, EditorWindow editorWindow, IList draggableList, int draggedItemIndex, object optionalData = null)
 {
     if (_dragData != null)
     {
         return;
     }
     Reset();
     _editor       = null;
     _editorWindow = editorWindow;
     _dragId       = dragId;
     _dragData     = new GUIDragData(draggableList, draggableList[draggedItemIndex], draggedItemIndex, optionalData);
     ClearDragDelayedCall();
     _dragDelayedCall = DeEditorUtils.DelayedCall(_DragDelay, () => _dragDelayElapsed = true);
 }