The drawer for Unity Object reference fields in Power Inspector has been enhanced with addition features.
The Drag N Drop Conundrum
How do you do that exactly?
If you try to drag-n-drop the target GameObject from the hierarchy view, it always just assigns its Transform Component.
The Object Picker is no help here either, as it can’t be used to select a specific Component inside a GameObject.
The only way to get around this problem in the default inspector is through an obscure and lengthy process involving the opening of multiple inspector windows and the locking of views. I suspect it’s something that many users don’t even know how to do.
In Power Inspector, if you drag a GameObject reference from the hierarchy view to a Component field, the quick select context menu pops open, letting you specify exactly which Component you wish to assign.
(If you do the same with an Unity Object field, the same thing happens, except this time the dragged GameObject is also listed as an additional option.)
Quick Select Context Menu
You can also manually open the quick select context menu by right-clicking the object reference control.
When opened in this manner, the menu will list all valid targets within the open Scenes.
All options will be hierarchically organized in the same order as they appear in the Hierarchy view, providing a fast and intuitive method for locating your target.
You can copy-paste values between Object reference class members in Power Inspector, just like you would with other fields.
In addition to this, you can paste references to the Object reference drawer from the following sources:
- References copied from GameObject, Component and asset headers in Power Inspector.
- References copied from the Hierarchy view.
- References copied from the Project view.
- Asset paths in the clipboard (for example via the “Copy Path” context menu item)
Note: Pasting reference from the Hierarchy and Project views works only when copied using the “Edit/Copy” menu item or with the keyboard shortcut Ctrl+C (Cmd+C on macOS). References copied using the context menu won’t work.