Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


DragAndDrop

Editor drag & drop operations.
Read time 1 minuteLast updated 2 days ago

Definition

  • Type: Class
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
public class DragAndDrop

Static Properties

Property

Description

activeControlIDGet or set ID of currently active drag and drop control.
entityIdsReferences to Entity Ids being dragged.
objectReferencesReferences to objects being dragged.
pathsThe file names being dragged.
visualModeThe visual indication of the drag.

Static Methods

Method

Description

AcceptDragAccept a drag operation.
AddDropHandlerV2Allow override of the default behavior for the corresponding window. Multiple handlers can be registered on the same window. If a handler returns DragAndDropVisualMode.None the system will check the next handler. Any other results (DragAndDropVisualMode.Rejected or others DragAndDropVisualMode) means this handler has processed the drop event and no other handler will be called. The last handler is the default Unity handler.
GetGenericDataGet data associated with current drag and drop operation.
HasHandlerCheck if the handler is already registered for the destination window ID.
PrepareStartDragClears drag & drop data.
RemoveDropHandlerV2Unregister a specific Drop Handler from a Window Drop Target.
SetGenericDataSet data associated with current drag and drop operation.
StartDragStart a drag operation.

Delegates

Delegate

Description

DragAndDrop.HierarchyDropHandlerV2Handler for the Hierarchy.
DragAndDrop.InspectorDropHandlerHandler for the Inspector.
DragAndDrop.ProjectBrowserDropHandlerV2Handler for the Project.
DragAndDrop.SceneDropHandlerHandler for the Scene.