From 94f2d9f7bb4a7b4103324eef5dbf3183ad0313ba Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 29 Jun 2021 17:32:13 +0900 Subject: [PATCH] ApplyModifiedProperties --- Assets/VRM10/Editor/Vrm10ExportDialog.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Assets/VRM10/Editor/Vrm10ExportDialog.cs b/Assets/VRM10/Editor/Vrm10ExportDialog.cs index 94e02e3542..b0c5512175 100644 --- a/Assets/VRM10/Editor/Vrm10ExportDialog.cs +++ b/Assets/VRM10/Editor/Vrm10ExportDialog.cs @@ -58,15 +58,12 @@ VRM10Object Vrm { return; } - if (m_metaEditor != null) - { - m_metaEditor = null; - } + m_metaEditor = default; m_meta = value; } } VRM10Object m_tmpObject; - VRM10MetaEditor m_metaEditor; + (VRM10MetaEditor, SerializedObject) m_metaEditor; protected override void Initialize() { @@ -238,18 +235,22 @@ protected override bool DoGUI(bool isValid) switch (_tab) { case Tabs.Meta: - if (m_metaEditor == null) + if (m_metaEditor.Item1 == null) { + SerializedObject so; if (m_meta != null) { - m_metaEditor = VRM10MetaEditor.Create(new SerializedObject(Vrm)); + so = new SerializedObject(Vrm); } else { - m_metaEditor = VRM10MetaEditor.Create(new SerializedObject(m_tmpObject)); + so = new SerializedObject(m_tmpObject); } + m_metaEditor = (VRM10MetaEditor.Create(so), so); } - m_metaEditor.OnInspectorGUI(); + m_metaEditor.Item2.Update(); + m_metaEditor.Item1.OnInspectorGUI(); + m_metaEditor.Item2.ApplyModifiedProperties(); break; case Tabs.Mesh: