- Home /
EditorWindow, Utility Popup, not using custom PropertyDrawers
I am popping up a “utility window”, using (http://docs.unity3d.com/ScriptReference/EditorWindow.ShowUtility.html ), which I use to display a SerializedObject. Some members of this object are a type of class for which a custom Property Drawer has been defined.
When I display these members in my normal “Inspector” Editor windows, their custom property drawer is used, and the property displays as expected.
However, when I use them in my utility EditorWindow, their custom PropertyDrawer is NOT used, and the property does NOT display as expected. Rather, it displays as if there were no custom PropertyDrawer defined for that class.
Both cases use the same command:
EditorGUILayout.PropertyField(serializedObject.FindProperty(“memberVariableOfClassWithCustomPropertyDrawer”));
The main difference between these two situations is that the Inspector one (which works) is defined as a class derived from “Editor”. But, the utility window is derived from a class called “EditorWindow”. I suspect this is the main reason I’m having trouble, though I don’t know what to do about it.
The other big difference is that in the EditorWindow, I need to instantiate and update my own serializedObject. But that seems to be working fine, and doubt it’s the issue.
Is there anyway to fix it such that the EditorWindow based version will automatically display the custom PropertyDrawers? If not, is there any way to manually specify what PropertyDrawer class to use?
I realize the question is very similar to: http://answers.unity3d.com/questions/1022461/how-to-get-propertydrawers-in-a-custom-editorwindo.html But as it remains unanswered, hoped asking a little differently would get an answer.