- Home /
DragAndDrop.StartDrag not worked on OSX
Hi, everyone.
I wrote an editor script to create a EditorWindow. It's use for manager some asset.
I call DragAndDrop.StartDrag() to start a drag&drop in this EditorWindow. Another EditorWindow can get DragPerform event to finish the drag&drop. It works very well on windows.
On the Mac, you can see the drag title, but can't get any DragXXXXX event. But if you drag a asset from project view to the EditorWindows, it works.
the code like this:
void OnGUI()
{
if (Event.current.type == Event.mouseDrag)
{
DragAndDrop.PrepareStartDrag();
DragAndDrop.StartDrag("DragComponent");
DragAndDrop.objectReferences = Selection.objects;
}
}
window2:
void OnGUI()
{
DragAndDrop.AcceptDrag();
if (Event.current.type == Event.DragUpdated )
{
DragAndDrop.visualMode = DragAndDropVisualMode.Link;
//dosomething
}
if (Event.current.type == Event.DragPerform )
{
//dosomething
}
}
Is there something wrong with my code? Or it is a bug? Does anyone know about this?
Answer by typehm · Aug 20, 2011 at 07:24 AM
Solved. I don't know why&how, but it works on OSX at now.
Your answer
![](https://koobas.hobune.stream/wayback/20220612184741im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Using native plugin with callbacks in editor (OS X) 3 Answers
drag and drop script 1 Answer
Unity says: "The System is Running out of memory." when it is not. 5 Answers
how to fix the "unityexception : launching ios project via xcode failed" exception ? 0 Answers
How to stack Prefabs in the scene dragged from Project List 0 Answers