33 lines
548 B
C#
33 lines
548 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace BitStrap
|
|
{
|
|
[Serializable]
|
|
public class PlayerPrefFloat : PlayerPrefProperty<float>
|
|
{
|
|
private float defaultValue;
|
|
|
|
public PlayerPrefFloat(string key)
|
|
: base(key)
|
|
{
|
|
}
|
|
|
|
public PlayerPrefFloat(string key, float defaultValue)
|
|
: base(key)
|
|
{
|
|
this.defaultValue = defaultValue;
|
|
}
|
|
|
|
protected override float OnRetrieveValue()
|
|
{
|
|
return PlayerPrefs.GetFloat(key, defaultValue);
|
|
}
|
|
|
|
protected override void OnSaveValue(float value)
|
|
{
|
|
PlayerPrefs.SetFloat(key, value);
|
|
}
|
|
}
|
|
}
|