No code example, documentation is vague, and google yields nothing.
Anyone know what they’re doing with this?
Also why couldn’t it be:
Object ShowObjectPicker( ObjectClass class, bool showSceneObjects )
As it is a unity editor function, I assume that’s the most streamlined method.
(Most everything else in editor is thread pausing, why not the object picker?)
I was still not sure how you use the control ID for a picker window. Here is what I did to get multiple object fields working with the picker.
Use the following code to open up a picker window with a specific control ID.
//in your EditorWindow class
int currentPickerWindow;
void ShowPicker() {
//create a window picker control ID
currentPickerWindow = EditorGUIUtility.GetControlID(FocusType.Passive) + 100;
//use the ID you just created
EditorGUIUtility.ShowObjectPicker<GameObject>(null,false,"ee",currentPickerWindow);
}
Then, in your method that draws the object field check for the event commandname “ObjectSelectorUpdated” and check if the open picker has your custom controlID. EditorGUIUtility.GetObjectPickerObject() should be the picker object you want.