using UnityEngine; namespace GFGGame { public class LocalCache { public static void SetBool(string key, bool isOn) { int value = isOn ? 1 : 0; PlayerPrefs.SetInt(key, value); PlayerPrefs.Save(); } public static bool GetBool(string key, bool defaultValue) { int defaultInt = defaultValue ? 1 : 0; int value = PlayerPrefs.GetInt(key, defaultInt); return value > 0; } public static void SetFloat(string key, float value) { PlayerPrefs.SetFloat(key, value); PlayerPrefs.Save(); } //public static float GetFloat(string key, float defaultValue) //{ // return PlayerPrefs.GetFloat(key, defaultValue); //} } }