Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use SettingProvider #989

Merged
merged 1 commit into from
May 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Assets/UniGLTF/Editor/UniGLTF/UniGLTFPreference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,18 @@ static IEnumerable<string> GetReimportPaths()
}
}

#if UNITY_2019_1_OR_NEWER
[SettingsProvider]
static SettingsProvider CreateProjectSettingsProvider()
{
var provider = new SettingsProvider("Preferences/UniGLTF",
SettingsScope.User, SettingsProvider.GetSearchKeywordsFromGUIContentProperties<Styles>());
provider.guiHandler = (sarchContext) => OnGUI();
return provider;
}
#else
[PreferenceItem("UniGLTF")]
#endif
private static void OnPreferenceGUI()
{
// language
Expand Down
13 changes: 11 additions & 2 deletions Assets/VRM/Editor/VrmPreference.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using UnityEngine;
using UnityEditor;
using System.Linq;

namespace VRM
{
Expand All @@ -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<Styles>());
provider.guiHandler = (sarchContext) => OnGUI();
return provider;
}
#else
[PreferenceItem("VRM0")]
#endif
private static void OnPreferenceGUI()
{
UniGLTF.UniGLTFPreference.ToggleSymbol(KEY_STOP_VRMASSETPOSTPROCESSOR, ASSETPOSTPROCESSOR_STOP_SYMBOL);
Expand Down