[UI Toolkit] Drag and drop objects like in hierarchy

Hi,
I’ve made a custom hierarchy view for my game. I’d like to be able to drag and drop objects from the hierarchy into the inspector like the built-in hierarchy supports. This poses two problems:

  • Onclick doesn’t seem to wait until mouse up, so dragging selects the clicked object immediately
  • How do I tell Unity that it’s dragging the underlying object?

The manual seems to have a tutorial for dragging between editor windows, so perhaps this helps get you onto the right track: Unity - Manual: Create a drag-and-drop UI to drag between Editor windows