#if !UNITY_EDITOR
    using System.Collections.Generic;
    using YG;

    public static class PlayerPrefs
    {
        public static void SetInt(string key, int value)
        {
            YG2.saves.DictInts[key] = value;
        }

        public static int GetInt(string key, int defaultValue = 0)
        {
            return YG2.saves.DictInts.GetValueOrDefault(key, defaultValue);
        }

        public static void SetFloat(string key, float value)
        {
            YG2.saves.DictFloats[key] = value;
        }

        public static float GetFloat(string key, float defaultValue = 0f)
        {
            return YG2.saves.DictFloats.GetValueOrDefault(key, defaultValue);
        }

        public static void SetString(string key, string value)
        {
            YG2.saves.DictStrings[key] = value;
        }

        public static string GetString(string key, string defaultValue = "")
        {
            return YG2.saves.DictStrings.GetValueOrDefault(key, defaultValue);
        }

        public static bool HasKey(string key)
        {
            return YG2.saves.DictStrings.ContainsKey(key) || YG2.saves.DictInts.ContainsKey(key) ||
                   YG2.saves.DictFloats.ContainsKey(key);
        }

        public static void DeleteKey(string key)
        {
            YG2.saves.DictStrings.Remove(key);
            YG2.saves.DictInts.Remove(key);
            YG2.saves.DictFloats.Remove(key);
        }

        public static void DeleteAll()
        {
            YG2.saves.DictStrings.Clear();
            YG2.saves.DictInts.Clear();
            YG2.saves.DictFloats.Clear();
        }

        public static void Save()
        {
            YG2.SaveProgress();
        }
    }

#endif