Firstborn/Library/PackageCache/com.unity.collab-proxy@2.0.3/Editor/PlasticSCM/UI/BoolSetting.cs

38 lines
914 B
C#
Raw Normal View History

2023-03-28 13:24:16 -04:00
using UnityEditor;
namespace Unity.PlasticSCM.Editor.UI
{
internal static class BoolSetting
{
internal static bool Load(
string boolSettingName,
bool defaultValue)
{
return EditorPrefs.GetBool(
GetSettingKey(boolSettingName),
defaultValue);
}
internal static void Save(
bool value,
string boolSettingName)
{
EditorPrefs.SetBool(
GetSettingKey(boolSettingName), value);
}
internal static void Clear(
string boolSettingName)
{
EditorPrefs.DeleteKey(
GetSettingKey(boolSettingName));
}
static string GetSettingKey(string boolSettingName)
{
return string.Format(
boolSettingName, PlayerSettings.productGUID);
}
}
}