UnityEditor.GameObjectsTreeViewDragging.DoDrag C# (CSharp) Method

DoDrag() public method

public DoDrag ( TreeViewItem parentItem, TreeViewItem targetItem, bool perform, TreeViewDragging dropPos ) : DragAndDropVisualMode
parentItem TreeViewItem
targetItem TreeViewItem
perform bool
dropPos TreeViewDragging
return DragAndDropVisualMode
        public override DragAndDropVisualMode DoDrag(TreeViewItem parentItem, TreeViewItem targetItem, bool perform, TreeViewDragging.DropPosition dropPos)
        {
            HierarchyProperty property = new HierarchyProperty(HierarchyType.GameObjects);
            if ((parentItem == null) || (targetItem == null))
            {
                return InternalEditorUtility.HierarchyWindowDrag(null, perform, InternalEditorUtility.HierarchyDropMode.kHierarchyDropUpon);
            }
            if (this.allowDragBetween)
            {
                if (((dropPos == TreeViewDragging.DropPosition.Above) || (targetItem == null)) || !property.Find(targetItem.id, null))
                {
                    property = null;
                }
            }
            else if (((dropPos == TreeViewDragging.DropPosition.Above) || (parentItem == null)) || !property.Find(parentItem.id, null))
            {
                property = null;
            }
            InternalEditorUtility.HierarchyDropMode kHierarchyDragNormal = InternalEditorUtility.HierarchyDropMode.kHierarchyDragNormal;
            if (this.allowDragBetween)
            {
                kHierarchyDragNormal = (dropPos != TreeViewDragging.DropPosition.Upon) ? InternalEditorUtility.HierarchyDropMode.kHierarchyDropBetween : InternalEditorUtility.HierarchyDropMode.kHierarchyDropUpon;
            }
            if (((parentItem != null) && (parentItem == targetItem)) && (dropPos != TreeViewDragging.DropPosition.Above))
            {
                kHierarchyDragNormal |= InternalEditorUtility.HierarchyDropMode.kHierarchyDropAfterParent;
            }
            return InternalEditorUtility.HierarchyWindowDrag(property, perform, kHierarchyDragNormal);
        }