Пример #1
0
 static void ClearDragDelayedCall()
 {
     if (_dragDelayedCall == null)
     {
         return;
     }
     DeEditorUtils.ClearDelayedCall(_dragDelayedCall);
     _dragDelayedCall = null;
 }
Пример #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);
 }