Пример #1
0
        static public bool DropZoneUnityObjects(Rect rect, out IList <UnityEngine.Object> dragging)
        {
            GUIControlHandle handle = GUIExtensions.GetControlHandle(FocusType.Passive);

            if (rect.Contains(handle.GetEvent().mousePosition))
            {
                dragging = DragAndDrop
                           .objectReferences
                           .ToList();

                if (dragging.IsNotEmpty())
                {
                    switch (handle.GetEventType())
                    {
                    case EventType.DragUpdated:
                        DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
                        break;

                    case EventType.DragPerform:
                        DragAndDrop.AcceptDrag();
                        handle.UseEvent();
                        return(true);
                    }
                }
            }

            dragging = Empty.IList <UnityEngine.Object>();
            return(false);
        }