Пример #1
0
        public void SetData(string key, byte[] value)
        {
            #if USE_BASE64_DATA_ENCODING
            string stringData = System.Convert.ToBase64String(value);
            #else
            string stringData = Encoding.Default.GetString(value);
            #endif

            CustomPlayerPrefs.SetString(key, stringData);
        }
Пример #2
0
        public string GetString(string key, string defaultValue = null)
        {
            string result = CustomPlayerPrefs.GetString(key, defaultValue);

            // HACK PlayerPrefs.GetString returns an empty string
            // despite of the default value was set to null
            if (defaultValue == null && string.IsNullOrEmpty(result))
            {
                result = null;
            }

            return(result);
        }
Пример #3
0
 public void Save() => CustomPlayerPrefs.Save();
Пример #4
0
 public void DeleteAll() => CustomPlayerPrefs.DeleteAll();
Пример #5
0
 public void DeleteKey(string key) => CustomPlayerPrefs.DeleteKey(key);
Пример #6
0
 public bool HasKey(string key) => CustomPlayerPrefs.HasKey(key);
Пример #7
0
 public void SetDate(string key, DateTime value) => CustomPlayerPrefs.SetDateTime(key, value);
Пример #8
0
 public DateTime GetDate(string key) => CustomPlayerPrefs.GetDateTime(key, DefaultDateTimeValue);
Пример #9
0
 public void SetBool(string key, bool value) => CustomPlayerPrefs.SetBool(key, value);
Пример #10
0
 public bool GetBool(string key, bool defaultValue) => CustomPlayerPrefs.GetBool(key, defaultValue);
Пример #11
0
 public void SetString(string key, string value) => CustomPlayerPrefs.SetString(key, value);
Пример #12
0
 public void SetFloat(string key, float value) => CustomPlayerPrefs.SetFloat(key, value);
Пример #13
0
 public float GetFloat(string key, float defaultValue = 0.0f) => CustomPlayerPrefs.GetFloat(key, defaultValue);
Пример #14
0
 public void SetLong(string key, long value) => CustomPlayerPrefs.SetString(key, value.ToString());
Пример #15
0
 public void SetInt(string key, int value) => CustomPlayerPrefs.SetInt(key, value);
Пример #16
0
 public int GetInt(string key, int defaultValue = 0) => CustomPlayerPrefs.GetInt(key, defaultValue);