From f1f007a261019c79502e093cddfe6ca86bb09f0f Mon Sep 17 00:00:00 2001 From: uurha Date: Sun, 1 Sep 2024 02:16:36 +0000 Subject: [PATCH] Merge pull request #50 from techno-dwarf-works/feature/refactoring Version 0.0.47 --- Editor/CustomEditors/MultiEditor.cs | 9 ++++++++- package.json | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Editor/CustomEditors/MultiEditor.cs b/Editor/CustomEditors/MultiEditor.cs index ddeaf07..5138238 100644 --- a/Editor/CustomEditors/MultiEditor.cs +++ b/Editor/CustomEditors/MultiEditor.cs @@ -76,7 +76,7 @@ private void Iterate(IReadOnlyList<(Type type, MultiEditorAttribute)> extensions var (type, betterEditorAttribute) = extensions[index]; if (!_overrideDefault && betterEditorAttribute.OverrideDefaultEditor) { - _overrideDefault = true; + SetOverrideDefault(true); } var extension = (ExtendedEditor)Activator.CreateInstance(type, paramArray); @@ -92,8 +92,15 @@ private void Iterate(IReadOnlyList<(Type type, MultiEditorAttribute)> extensions } } + protected void SetOverrideDefault(bool value) + { + _overrideDefault = value; + } + public override VisualElement CreateInspectorGUI() { + var m = Editor.CreateInstance(); + m.SetOverrideDefault(false); var container = new VisualElement(); for (var i = 0; i < _preEditors.Count; i++) diff --git a/package.json b/package.json index 22f2a0f..1324a03 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.tdw.better.commons", "displayName": "Better Commons", - "version": "0.0.46", + "version": "0.0.47", "unity": "2021.3", "description": " ", "dependencies": {