12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using UnityEditor.SettingsManagement;
- namespace UnityEditor.SettingsManagement.Examples
- {
-
-
-
- static class MySettingsManager
- {
-
-
- internal const string k_PackageName = "com.unity.settings-manager-examples";
- static Settings s_Instance;
- internal static Settings instance
- {
- get
- {
- if (s_Instance == null)
- s_Instance = new Settings(k_PackageName);
- return s_Instance;
- }
- }
-
- public static void Save()
- {
- instance.Save();
- }
- public static T Get<T>(string key, SettingsScope scope = SettingsScope.Project, T fallback = default(T))
- {
- return instance.Get<T>(key, scope, fallback);
- }
- public static void Set<T>(string key, T value, SettingsScope scope = SettingsScope.Project)
- {
- instance.Set<T>(key, value, scope);
- }
- public static bool ContainsKey<T>(string key, SettingsScope scope = SettingsScope.Project)
- {
- return instance.ContainsKey<T>(key, scope);
- }
- }
- }
|