Version: 2021.2

DragAndDrop

class in UnityEditor

切换到手册

描述

编辑器拖放操作。

静态变量

activeControlID获取或设置当前处于活动状态的拖放控件的 ID。
objectReferences对拖动的 objects 的引用。
paths正在拖动的文件名。
visualMode拖动的可视指示。

静态函数

AcceptDrag接受拖动操作。
AddDropHandlerAllow 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.
GetGenericData获取与当前拖放操作相关的数据。
HasHandlerCheck if the handler is already registered for the destination window ID.
PrepareStartDrag清除拖放数据。
RemoveDropHandlerUnregister a specific Drop Handler from a Window Drop Target.
SetGenericData设置与当前拖放操作相关的数据。
StartDrag开始拖动操作。

委托

HierarchyDropHandlerHandler for the Hierarchy.
InspectorDropHandlerHandler for the Inspector.
ProjectBrowserDropHandlerHandler for the Project.
SceneDropHandlerHandler for the Scene.