Rasagar/Library/PackageCache/com.unity.settings-manager/Samples~/PackageWithProjectAndUserSettings/MySettingsWrapper.cs

17 lines
723 B
C#
Raw Normal View History

2024-08-26 13:07:20 -07: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) { }
}
}