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