Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public void Save() => CustomPlayerPrefs.Save();
Esempio n. 4
0
 public void DeleteAll() => CustomPlayerPrefs.DeleteAll();
Esempio n. 5
0
 public void DeleteKey(string key) => CustomPlayerPrefs.DeleteKey(key);
Esempio n. 6
0
 public bool HasKey(string key) => CustomPlayerPrefs.HasKey(key);
Esempio n. 7
0
 public void SetDate(string key, DateTime value) => CustomPlayerPrefs.SetDateTime(key, value);
Esempio n. 8
0
 public DateTime GetDate(string key) => CustomPlayerPrefs.GetDateTime(key, DefaultDateTimeValue);
Esempio n. 9
0
 public void SetBool(string key, bool value) => CustomPlayerPrefs.SetBool(key, value);
Esempio n. 10
0
 public bool GetBool(string key, bool defaultValue) => CustomPlayerPrefs.GetBool(key, defaultValue);
Esempio n. 11
0
 public void SetString(string key, string value) => CustomPlayerPrefs.SetString(key, value);
Esempio n. 12
0
 public void SetFloat(string key, float value) => CustomPlayerPrefs.SetFloat(key, value);
Esempio n. 13
0
 public float GetFloat(string key, float defaultValue = 0.0f) => CustomPlayerPrefs.GetFloat(key, defaultValue);
Esempio n. 14
0
 public void SetLong(string key, long value) => CustomPlayerPrefs.SetString(key, value.ToString());
Esempio n. 15
0
 public void SetInt(string key, int value) => CustomPlayerPrefs.SetInt(key, value);
Esempio n. 16
0
 public int GetInt(string key, int defaultValue = 0) => CustomPlayerPrefs.GetInt(key, defaultValue);