Files
UltimateFishing/Assets/Scripts/Assembly-CSharp/BitStrap/PlayerPrefInt.cs
2026-02-21 16:45:37 +08:00

33 lines
528 B
C#

using System;
using UnityEngine;
namespace BitStrap
{
[Serializable]
public class PlayerPrefInt : PlayerPrefProperty<int>
{
private int defaultValue;
public PlayerPrefInt(string key)
: base(key)
{
}
public PlayerPrefInt(string key, int defaultValue)
: base(key)
{
this.defaultValue = defaultValue;
}
protected override int OnRetrieveValue()
{
return PlayerPrefs.GetInt(key, defaultValue);
}
protected override void OnSaveValue(int value)
{
PlayerPrefs.SetInt(key, value);
}
}
}