playtest-unity/playtest/Library/PackageCache/com.unity.settings-manager@.../Samples~/PackageWithProjectAndUserSe.../MySettingsWrapper.cs

17 lines
723 B
C#

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) { }
}
}