From 2016d636c0545e41685e558ffb403854dadf5487 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 28 May 2021 16:45:19 +0900 Subject: [PATCH] use SettingProvider workaround https://github.com/Unity-Technologies/com.unity.cinemachine/blob/master/Editor/Windows/CinemachineSettings.cs#L313 --- Assets/UniGLTF/Editor/UniGLTF/UniGLTFPreference.cs | 11 +++++++++++ Assets/VRM/Editor/VrmPreference.cs | 13 +++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Assets/UniGLTF/Editor/UniGLTF/UniGLTFPreference.cs b/Assets/UniGLTF/Editor/UniGLTF/UniGLTFPreference.cs index 514bb609d1..d89cfe78af 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/UniGLTFPreference.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/UniGLTFPreference.cs @@ -34,7 +34,18 @@ static IEnumerable GetReimportPaths() } } +#if UNITY_2019_1_OR_NEWER + [SettingsProvider] + static SettingsProvider CreateProjectSettingsProvider() + { + var provider = new SettingsProvider("Preferences/UniGLTF", + SettingsScope.User, SettingsProvider.GetSearchKeywordsFromGUIContentProperties()); + provider.guiHandler = (sarchContext) => OnGUI(); + return provider; + } +#else [PreferenceItem("UniGLTF")] +#endif private static void OnPreferenceGUI() { // language diff --git a/Assets/VRM/Editor/VrmPreference.cs b/Assets/VRM/Editor/VrmPreference.cs index 84f6615258..41a31608c0 100644 --- a/Assets/VRM/Editor/VrmPreference.cs +++ b/Assets/VRM/Editor/VrmPreference.cs @@ -1,6 +1,4 @@ -using UnityEngine; using UnityEditor; -using System.Linq; namespace VRM { @@ -9,7 +7,18 @@ public static class VrmPreference const string KEY_STOP_VRMASSETPOSTPROCESSOR = "StopVrmAssetPostProcessor"; const string ASSETPOSTPROCESSOR_STOP_SYMBOL = "VRM_STOP_ASSETPOSTPROCESSOR"; +#if UNITY_2019_1_OR_NEWER + [SettingsProvider] + static SettingsProvider CreateProjectSettingsProvider() + { + var provider = new SettingsProvider("Preferences/VRM0", + SettingsScope.User, SettingsProvider.GetSearchKeywordsFromGUIContentProperties()); + provider.guiHandler = (sarchContext) => OnGUI(); + return provider; + } +#else [PreferenceItem("VRM0")] +#endif private static void OnPreferenceGUI() { UniGLTF.UniGLTFPreference.ToggleSymbol(KEY_STOP_VRMASSETPOSTPROCESSOR, ASSETPOSTPROCESSOR_STOP_SYMBOL);