First commit for private source control. Older commits available on Github.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using UnityEditor;
|
||||
|
||||
namespace NaughtyAttributes.Editor
|
||||
{
|
||||
internal class SavedBool
|
||||
{
|
||||
private bool _value;
|
||||
private string _name;
|
||||
|
||||
public bool Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return _value;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (_value == value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_value = value;
|
||||
EditorPrefs.SetBool(_name, value);
|
||||
}
|
||||
}
|
||||
|
||||
public SavedBool(string name, bool value)
|
||||
{
|
||||
_name = name;
|
||||
_value = EditorPrefs.GetBool(name, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user