Search Unity

DragAndDrop to Hierarchy / Project / Objects

Discussion in 'Editor & General Support' started by Shrubokrant, Aug 8, 2018.

  1. Shrubokrant

    Shrubokrant

    Joined:
    Oct 2, 2016
    Posts:
    80
    I've been making some experiments with the DragAndDrop class of Unity, but so far, I haven't been able to create a drag from a custom zone of a custom window that would work like a normal drag and drop.

    I can drop any objects from the hierarchy or the project window, but I cannot drag an object from my editor back into the project or the hierarchy window (the drag and drop shows as forbidden and wont accept it)

    Any idea on how to make it work, or if it's even possible? I checked the C# sources, and it seems that a lot of the Drag and Drop features are internal and cannot be used.
     
  2. Shrubokrant

    Shrubokrant

    Joined:
    Oct 2, 2016
    Posts:
    80
    I also saw few undocumented methods in InternalEditorUtility:
    InternalEditorUtility.HierarchyWindowDrag
    InternalEditorUtility.ProjectWindowDrag
    InternalEditorUtility.SceneViewDrag

    I have no idea how they work, and I haven't been able to see any change by using them :/