You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
672 B
C#
24 lines
672 B
C#
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<string> GetAllKeys()
|
|
{
|
|
var keysString = PlayerPrefs.GetString(KeyRegistry, "");
|
|
return new List<string>(keysString.Split(';', System.StringSplitOptions.RemoveEmptyEntries));
|
|
}
|
|
}
|