GameVsJam/3d Prototyp/Library/PackageCache/com.unity.settings-manager@.../Samples~/PackageWithProjectAndUserSe.../MySettingsWrapper.cs

17 lines
739 B
C#
Raw Normal View History

2024-04-03 11:41:53 +02:00
using UnityEditor.SettingsManagement;
namespace UnityEditor.SettingsManagement.Examples
{
// Usually you will only have a single Settings instance, so it is convenient to define a UserSetting<T> implementation
// that points to your instance. In this way you avoid having to pass the Settings parameter in setting field definitions.
class MySetting<T> : UserSetting<T>
{
public MySetting(string key, T value, SettingsScope scope = SettingsScope.Project)
: base(MySettingsManager.instance, key, value, scope)
{}
MySetting(Settings settings, string key, T value, SettingsScope scope = SettingsScope.Project)
: base(settings, key, value, scope) { }
}
}