public override void Drag(object[] dragObjects, PointerEventData pointerEventData)
 {
     base.Drag(dragObjects, pointerEventData);
     m_listBox.ExternalItemDrag(pointerEventData.position);
     if (!CanCreatePrefab((ProjectItem)m_listBox.DropTarget, dragObjects))
     {
         m_listBox.ClearTarget();
     }
     Editor.DragDrop.SetCursor(KnownCursor.DropAllowed);
 }
Example #2
0
        protected virtual void OnDrag(PointerEventData pointerEventData)
        {
            object[] dragObjects = Editor.DragDrop.DragObjects;
            m_listBox.ExternalItemDrag(pointerEventData.position);
            if (!CanCreatePrefab((ProjectItem)m_listBox.DropTarget, dragObjects))
            {
                m_listBox.ClearTarget();

                Editor.DragDrop.SetCursor(KnownCursor.DropNotAllowed);
            }
            else
            {
                ProjectItem dropTarget = (ProjectItem)m_listBox.DropTarget;
                if (dropTarget != null && !dropTarget.IsFolder)
                {
                    m_listBox.ClearTarget();
                }

                Editor.DragDrop.SetCursor(KnownCursor.DropAllowed);
            }
        }
Example #3
0
 public override void Drag(object[] dragObjects, PointerEventData pointerEventData)
 {
     base.Drag(dragObjects, pointerEventData);
     m_treeView.ExternalItemDrag(pointerEventData.position);
     if (CanDrop((ProjectItem)m_treeView.DropTarget, dragObjects))
     {
         Editor.DragDrop.SetCursor(KnownCursor.DropAllowed);
     }
     else
     {
         Editor.DragDrop.SetCursor(KnownCursor.DropNowAllowed);
         m_treeView.ClearTarget();
     }
 }
Example #4
0
 protected virtual void OnDrag(PointerEventData pointerEventData)
 {
     object[] dragObjects = Editor.DragDrop.DragObjects;
     m_treeView.ExternalItemDrag(pointerEventData.position);
     m_lastDropAction = m_treeView.DropAction;
     if (CanDrop(dragObjects))
     {
         Editor.DragDrop.SetCursor(KnownCursor.DropAllowed);
     }
     else
     {
         Editor.DragDrop.SetCursor(KnownCursor.DropNotAllowed);
         m_treeView.ClearTarget();
     }
 }
Example #5
0
        public override void Drag(object[] dragObjects, PointerEventData pointerEventData)
        {
            base.Drag(dragObjects, pointerEventData);
            m_treeView.ExternalItemDrag(pointerEventData.position);

            bool canCreatePrefab = CanCreatePrefab((ProjectItem)m_treeView.DropTarget, dragObjects);
            bool canDrop = CanDrop((ProjectItem)m_treeView.DropTarget, dragObjects);
            if (!canCreatePrefab && !canDrop)
            {
                m_treeView.ClearTarget();

                Editor.DragDrop.SetCursor(KnownCursor.DropNotAllowed);
            }
            else
            {
                Editor.DragDrop.SetCursor(KnownCursor.DropAllowed);
            }
        }
        protected virtual void OnDrag(PointerEventData pointerEventData)
        {
            m_treeView.ExternalItemDrag(pointerEventData.position);
            object[] dragObjects     = Editor.DragDrop.DragObjects;
            bool     canCreatePrefab = CanCreatePrefab((ProjectItem)m_treeView.DropTarget, dragObjects);
            bool     canDrop         = CanDrop((ProjectItem)m_treeView.DropTarget, dragObjects);

            if (!canCreatePrefab && !canDrop)
            {
                m_treeView.ClearTarget();

                Editor.DragDrop.SetCursor(KnownCursor.DropNotAllowed);
            }
            else
            {
                Editor.DragDrop.SetCursor(KnownCursor.DropAllowed);
            }
        }