- if(Event.current.type == EventType.DragUpdated || Event.current.type == EventType.DragPerform)
- {
- if(!IsImageAsset (DragAndDrop.objectReferences [0]))
- {
- //如果不能创建Image返回让系统自己处理。
- return;
- }
- DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
- if(Event.current.type == EventType.DragPerform)
- //松开鼠标
- {
- DragAndDrop.AcceptDrag();
- //此处添加创建Image的代码
- ......
- }
- Event.current.Use ();
- }
来源: http://www.bubuko.com/infodetail-1960843.html