CustomEditor with "editorForChildClasses: true" is not respected

Issue #833 new
Artem Perepelitsa created an issue

Odin Inspector replaces a default editor for MonoBehaviours with the custom editor of type OdinEditor. However, when a custom editor for MonoBehaviour is defined with editorForChildClasses: true is defined, all child classes receive OdinEditor as their custom editor instead of the defined custom editor.

Steps To Reproduce:
1. Open the attached project.
2. Import Odin Inspector.
3. Open Assets/Scripts/Editor/MonoBehaviourEditor.cs in a code editor, note its contents.
4. Open Scenes/SampleScene, click on the game object named “GameObject“.
5. Note that it doesn’t show the “Custom editor“ label.
6. Press the “Test Editor Type“ button.

Actual Result:
Custom editor for MonoBehaviour: MonoBehaviourEditor
Custom editor for TestBehaviour: Sirenix.OdinInspector.Editor.OdinEditor

Expected Result:

Custom editor for MonoBehaviour: MonoBehaviourEditor
Custom editor for TestBehaviour: MonoBehaviourEditor

Unity version: 2021.2.6
Odin version: 3.0.12.0
Editor Only Mode: enabled
OS: Windows

Comments (0)

  1. Log in to comment