diff --git a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/EditorMaterial.cs b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/EditorMaterial.cs index 5a252d62c..1801dc846 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/EditorMaterial.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/EditorMaterial.cs @@ -14,20 +14,6 @@ using UnityEditor.Experimental.AssetImporters; namespace UniGLTF { - public class TmpGuiEnable : IDisposable - { - bool m_backup; - public TmpGuiEnable(bool enable) - { - m_backup = GUI.enabled; - GUI.enabled = enable; - } - - public void Dispose() - { - GUI.enabled = m_backup; - } - } public static class EditorMaterial { static bool s_foldMaterials = true; @@ -36,7 +22,7 @@ namespace UniGLTF public static void OnGUI(ScriptedImporter importer, GltfParser parser, ITextureDescriptorGenerator textureDescriptorGenerator, Func textureDir, Func materialDir) { var hasExternal = importer.GetExternalObjectMap().Any(x => x.Value is Material || x.Value is Texture2D); - using (new TmpGuiEnable(!hasExternal)) + using (new EditorGUI.DisabledGroupScope(!hasExternal)) { if (GUILayout.Button("Extract Materials And Textures ...")) { diff --git a/Assets/VRM10/Editor/ScriptedImporter/EditorVrm.cs b/Assets/VRM10/Editor/ScriptedImporter/EditorVrm.cs index 0c25c3e47..798665599 100644 --- a/Assets/VRM10/Editor/ScriptedImporter/EditorVrm.cs +++ b/Assets/VRM10/Editor/ScriptedImporter/EditorVrm.cs @@ -30,7 +30,7 @@ namespace UniVRM10 public static void OnGUI(ScriptedImporter importer, GltfParser parser, UniGLTF.Extensions.VRMC_vrm.VRMC_vrm vrm) { var hasExternal = importer.GetExternalObjectMap().Any(x => x.Value is VRM10MetaObject || x.Value is VRM10ExpressionAvatar || x.Value is VRM10Expression); - using (new TmpGuiEnable(!hasExternal)) + using (new EditorGUI.DisabledScope(!hasExternal)) { if (GUILayout.Button("Extract Meta And Expressions ...")) {