示例#1
0
        protected void FinalizeDragPerformed(bool revertExpanded)
        {
            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(list[0].GetInstanceID(), m_TreeView.data.GetRows()) == null)
            {
                draggedItemsFromOwnTreeView = false;
            }

            int[] draggedIDs = new int[list.Count];
            for (int index = 0; index < list.Count; ++index)
            {
                if (list[index] != null)
                {
                    draggedIDs[index] = list[index].GetInstanceID();
                }
            }
            m_TreeView.NotifyListenersThatDragEnded(draggedIDs, draggedItemsFromOwnTreeView);
        }
 private List <TreeViewItem> GetItemsFromIDs(IEnumerable <int> draggedItemIDs)
 {
     return(TreeViewUtility.FindItemsInList(draggedItemIDs, m_TreeView.data.GetRows()));
 }
 public virtual TreeViewItem FindItem(int id)
 {
     return(TreeViewUtility.FindItem(id, m_RootItem));
 }