コード例 #1
0
        public static void StartDrag(ISceneDragReceiver receiver, string title, object data = null)
        {
            //stop any drag before starting a new one

            StopDrag();

            if (receiver != null)
            {
                //make sure we release any control from something that has it
                //this is done because SceneView delegate needs DragEvents!

                GUIUtility.hotControl = 0;

                //do the necessary steps to start a drag
                //we set the GenericData to our receiver so it can handle

                DragAndDrop.PrepareStartDrag();
                DragAndDrop.objectReferences = emptyObjects;
                DragAndDrop.paths            = emptyPaths;
                DragAndDrop.SetGenericData(DRAG_ID, new DragData(receiver, data));

                receiver.StartDrag(data);

                //start drag and listen for Scene drop

                DragAndDrop.StartDrag(title);

                SceneView.duringSceneGui += OnSceneGUI;
            }
        }
コード例 #2
0
 public DragData(ISceneDragReceiver receiver, object data)
 {
     this.receiver = receiver;
     this.data     = data;
 }