DragAndDrop 拖放


Editor drag & drop operations.

编辑器的拖放操作。

Note: This is an editor class. To use it you have to place your script in Assets/Editor inside your project folder. Editor classes are in the UnityEditor namespace so for C# scripts you need to add "using UnityEditor;" at the beginning of the script.
 注意:这是一个编辑器类,如果想使用它你需要把它放到工程目录下的Assets/Editor文件夹下。编辑器类在UnityEditor命名空间下。所以当使用C#脚本时,你需要在脚本前面加上 "using UnityEditor"引用。

Class Variables类变量

  • objectReferences
    References to objects being dragged.
       物体的引用被拖动。
  • paths
    The file names being dragged.
       被拖动的文件名称。
  • visualMode
    The visual indication of the drag.
       拖动的可视化。
  • activeControlID
    Get or set ID of currently active drag and drop control.
       获取或设置当前激活拖放控件ID。

Class Functions类函数

  • PrepareStartDrag
    Clears drag & drop data.
       清除拖放数据。
  • StartDrag
    Start a drag operation.
       开始一个拖放操作。
  • AcceptDrag
    Accept a drag operation.
       接受一个拖拽操作。
  • GetGenericData
    Get data associated with current drag and drop operation.
       获取相关数据,带有当前拖放操作。
  • SetGenericData
    Set data associated with current drag and drop operation.
       设置相关数据,带有当前拖放操作。


,