public override DragAndDropVisualMode DoDrag(TreeViewItem parentItem, TreeViewItem targetItem, bool perform, TreeViewDragging.DropPosition dropPos) { HierarchyProperty hierarchyProperty = 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 || !hierarchyProperty.Find(targetItem.id, null)) { hierarchyProperty = null; } } else { if (dropPos == TreeViewDragging.DropPosition.Above || parentItem == null || !hierarchyProperty.Find(parentItem.id, null)) { hierarchyProperty = null; } } InternalEditorUtility.HierarchyDropMode hierarchyDropMode = InternalEditorUtility.HierarchyDropMode.kHierarchyDragNormal; if (this.allowDragBetween) { hierarchyDropMode = ((dropPos != TreeViewDragging.DropPosition.Upon) ? InternalEditorUtility.HierarchyDropMode.kHierarchyDropBetween : InternalEditorUtility.HierarchyDropMode.kHierarchyDropUpon); } if (parentItem != null && parentItem == targetItem && dropPos != TreeViewDragging.DropPosition.Above) { hierarchyDropMode |= InternalEditorUtility.HierarchyDropMode.kHierarchyDropAfterParent; } return(InternalEditorUtility.HierarchyWindowDrag(hierarchyProperty, perform, hierarchyDropMode)); }
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)); }
public override DragAndDropVisualMode DoDrag(TreeViewItem parentItem, TreeViewItem targetItem, bool perform, TreeViewDragging.DropPosition dropPos) { DragAndDropVisualMode dragAndDropVisualMode = this.DoDragScenes(parentItem as GameObjectTreeViewItem, targetItem as GameObjectTreeViewItem, perform, dropPos); DragAndDropVisualMode result; if (dragAndDropVisualMode != DragAndDropVisualMode.None) { result = dragAndDropVisualMode; } else { InternalEditorUtility.HierarchyDropMode hierarchyDropMode = InternalEditorUtility.HierarchyDropMode.kHierarchyDragNormal; bool flag = !string.IsNullOrEmpty(((GameObjectTreeViewDataSource)this.m_TreeView.data).searchString); if (flag) { hierarchyDropMode |= InternalEditorUtility.HierarchyDropMode.kHierarchySearchActive; } if (parentItem == null || targetItem == null) { hierarchyDropMode |= InternalEditorUtility.HierarchyDropMode.kHierarchyDropUpon; result = InternalEditorUtility.HierarchyWindowDrag(null, perform, hierarchyDropMode); } else { HierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.GameObjects); if (!hierarchyProperty.Find(targetItem.id, null)) { hierarchyProperty = null; } bool flag2 = dropPos == TreeViewDragging.DropPosition.Upon; if (flag && !flag2) { result = DragAndDropVisualMode.None; } else { hierarchyDropMode |= ((!flag2) ? InternalEditorUtility.HierarchyDropMode.kHierarchyDropBetween : InternalEditorUtility.HierarchyDropMode.kHierarchyDropUpon); bool flag3 = parentItem != null && targetItem != parentItem && dropPos == TreeViewDragging.DropPosition.Above && parentItem.children[0] == targetItem; if (flag3) { hierarchyDropMode |= InternalEditorUtility.HierarchyDropMode.kHierarchyDropAfterParent; } result = InternalEditorUtility.HierarchyWindowDrag(hierarchyProperty, perform, hierarchyDropMode); } } } return(result); }
public override DragAndDropVisualMode DoDrag(TreeViewItem parentItem, TreeViewItem targetItem, bool perform, TreeViewDragging.DropPosition dropPos) { DragAndDropVisualMode dragAndDropVisualMode = this.DoDragScenes(parentItem as GameObjectTreeViewItem, targetItem as GameObjectTreeViewItem, perform, dropPos); DragAndDropVisualMode result; if (dragAndDropVisualMode != DragAndDropVisualMode.None) { result = dragAndDropVisualMode; } else if (parentItem == null || targetItem == null) { result = InternalEditorUtility.HierarchyWindowDrag(null, perform, InternalEditorUtility.HierarchyDropMode.kHierarchyDropUpon); } else { HierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.GameObjects); if (this.allowDragBetween) { if (!hierarchyProperty.Find(targetItem.id, null)) { hierarchyProperty = null; } } else if (!hierarchyProperty.Find(parentItem.id, null)) { hierarchyProperty = null; } InternalEditorUtility.HierarchyDropMode hierarchyDropMode = InternalEditorUtility.HierarchyDropMode.kHierarchyDragNormal; if (this.allowDragBetween) { hierarchyDropMode = ((dropPos != TreeViewDragging.DropPosition.Upon) ? InternalEditorUtility.HierarchyDropMode.kHierarchyDropBetween : InternalEditorUtility.HierarchyDropMode.kHierarchyDropUpon); } bool flag = parentItem != null && targetItem != parentItem && dropPos == TreeViewDragging.DropPosition.Above && parentItem.children[0] == targetItem; if (flag) { hierarchyDropMode |= InternalEditorUtility.HierarchyDropMode.kHierarchyDropAfterParent; } result = InternalEditorUtility.HierarchyWindowDrag(hierarchyProperty, perform, hierarchyDropMode); } return(result); }
public override DragAndDropVisualMode DoDrag(TreeViewItem parentItem, TreeViewItem targetItem, bool perform, TreeViewDragging.DropPosition dropPos) { DragAndDropVisualMode andDropVisualMode = this.DoDragScenes(parentItem as GameObjectTreeViewItem, targetItem as GameObjectTreeViewItem, perform, dropPos); if (andDropVisualMode != DragAndDropVisualMode.None) { return(andDropVisualMode); } if (parentItem == null || targetItem == null) { return(InternalEditorUtility.HierarchyWindowDrag((HierarchyProperty)null, perform, InternalEditorUtility.HierarchyDropMode.kHierarchyDropUpon)); } HierarchyProperty property = new HierarchyProperty(HierarchyType.GameObjects); if (this.allowDragBetween) { if (dropPos == TreeViewDragging.DropPosition.Above || !property.Find(targetItem.id, (int[])null)) { property = (HierarchyProperty)null; } } else if (dropPos == TreeViewDragging.DropPosition.Above || !property.Find(parentItem.id, (int[])null)) { property = (HierarchyProperty)null; } InternalEditorUtility.HierarchyDropMode dropMode = InternalEditorUtility.HierarchyDropMode.kHierarchyDragNormal; if (this.allowDragBetween) { dropMode = dropPos != TreeViewDragging.DropPosition.Upon ? InternalEditorUtility.HierarchyDropMode.kHierarchyDropBetween : InternalEditorUtility.HierarchyDropMode.kHierarchyDropUpon; } if (parentItem != null && parentItem == targetItem && dropPos != TreeViewDragging.DropPosition.Above) { dropMode |= InternalEditorUtility.HierarchyDropMode.kHierarchyDropAfterParent; } return(InternalEditorUtility.HierarchyWindowDrag(property, perform, dropMode)); }
public static extern DragAndDropVisualMode HierarchyWindowDrag(HierarchyProperty property, bool perform, InternalEditorUtility.HierarchyDropMode dropMode);