DragAndDrop.PrepareStartDrag 准备开始拖放


static function PrepareStartDrag () : void

Description描述

Clears drag & drop data.

清除拖放数据。

Clears everything stored in the drag & drop object and prepares it so you can write into it for initiating a drag operation.

清除所有储存在拖放物体的数据,并准备;所以你可以写入初始拖动操作。

参见:StartDrag, paths, objectReferences.

function OnGUI () {if (Event.current.type == EventType.MouseDrag) {// Clear out drag data//清除拖放数据DragAndDrop.PrepareStartDrag ();// Set up what we want to drag//设置拖放物体DragAndDrop.paths = [ "/Users/joe/myPath.txt" ];// Start the actual drag//开始实际拖放DragAndDrop.StartDrag ("Dragging title");// Make sure no one uses the event after us//确保之后没有东西使用这个事件Event.current.Use();}}


,