x


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?

more ▼

asked Aug 20 '11 at 06:09 AM

typehm gravatar image

typehm
1 1 1 1

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Solved. I don't know why&how, but it works on OSX at now.

more ▼

answered Aug 20 '11 at 07:24 AM

typehm gravatar image

typehm
1 1 1 1

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1673
x84
x55

asked: Aug 20 '11 at 06:09 AM

Seen: 732 times

Last Updated: Aug 20 '11 at 07:24 AM