using System.Collections.Generic; namespace Wizard; public class PlayerPrefsCache { private Dictionary _intCache = new Dictionary(); private static PlayerPrefsCache _instance; public static PlayerPrefsCache Instance { get { if (_instance == null) { _instance = new PlayerPrefsCache(); } return _instance; } } public static void OnSoftwareReset() { _instance = null; } public int GetValue(KeyValuePair id) { if (_intCache.TryGetValue(id.Key, out var value)) { return value; } value = PlayerPrefsWrapper.GetValue(id); _intCache.Add(id.Key, value); return value; } }