void FinalizeDragPerformed(bool revertExpanded)
        {
            DragCleanup(revertExpanded);
            DragAndDrop.AcceptDrag();

            List <Object> objs = new List <Object>(DragAndDrop.objectReferences); // TODO, what about when dragging non objects...

            bool draggedItemsFromOwnTreeView = true;

            if (objs.Count > 0 && objs[0] != null && TreeViewUtility.FindItemInList(objs[0].GetInstanceID(), m_TreeView.data.GetRows()) == null)
            {
                draggedItemsFromOwnTreeView = false;
            }

            int[] newSelection = new int[objs.Count];
            for (int i = 0; i < objs.Count; ++i)
            {
                if (objs[i] == null)
                {
                    continue;
                }

                newSelection[i] = (objs[i].GetInstanceID());
            }
            m_TreeView.NotifyListenersThatDragEnded(newSelection, draggedItemsFromOwnTreeView);
            Undo.SetCurrentGroupName(Constants.UndoActionName);
        }
Exemple #2
0
        private void FinalizeDragPerformed(bool revertExpanded)
        {
            this.DragCleanup(revertExpanded);
            DragAndDrop.AcceptDrag();
            List <UnityEngine.Object> list   = new List <UnityEngine.Object>(DragAndDrop.objectReferences);
            bool draggedItemsFromOwnTreeView = true;

            if (list.Count > 0 && list[0] != null && TreeViewUtility.FindItemInList <TreeViewItem>(list[0].GetInstanceID(), this.m_TreeView.data.GetRows()) == null)
            {
                draggedItemsFromOwnTreeView = false;
            }
            int[] array = new int[list.Count];
            for (int i = 0; i < list.Count; i++)
            {
                if (!(list[i] == null))
                {
                    array[i] = list[i].GetInstanceID();
                }
            }
            this.m_TreeView.NotifyListenersThatDragEnded(array, draggedItemsFromOwnTreeView);
        }