using UnityEngine; public static class SafePlayerPrefs { public static void SetInt(string key, int value) { PlayerPrefs.SetInt(key, value); PlayerPrefsKeys.RegisterKey(key); PlayerPrefs.Save(); } public static void SetFloat(string key, float value) { PlayerPrefs.SetFloat(key, value); PlayerPrefsKeys.RegisterKey(key); PlayerPrefs.Save(); } public static void SetString(string key, string value) { PlayerPrefs.SetString(key, value); PlayerPrefsKeys.RegisterKey(key); PlayerPrefs.Save(); } }