using System.Collections.Generic; using UnityEngine; public static class PlayerPrefsKeys { private const string KeyRegistry = "_AllPlayerPrefsKeys"; public static void RegisterKey(string key) { var keys = PlayerPrefs.GetString(KeyRegistry, ""); if (!keys.Contains(key)) { keys += key + ";"; SafePlayerPrefs.SetString(KeyRegistry, keys); PlayerPrefs.Save(); } } public static List GetAllKeys() { var keysString = PlayerPrefs.GetString(KeyRegistry, ""); return new List(keysString.Split(';', System.StringSplitOptions.RemoveEmptyEntries)); } }