コード例 #1
0
        public async Task <bool> ContainsKey(string key)
        {
            var res = PlayerPrefsV2.HasKey(key);

            if (!res && fallbackStore != null)
            {
                return(await fallbackStore.ContainsKey(key));
            }
            return(res);
        }
コード例 #2
0
        private T InternalGet <T>(string key, T defaultValue)
        {
            if (!PlayerPrefsV2.HasKey(key))
            {
                return(defaultValue);
            }
            var value   = PlayerPrefsV2.GetString(key);
            var wrapper = jsonReader.Read <ValueWrapper>(value);

            if (wrapper == null)
            {
                Log.e($"Entry not a ValueWrapper but instead: '{value}'");
                return(defaultValue);
            }
            return(wrapper.GetValueAs <T>());
        }