private static void SetUserAccess(bool logged) { int loggedIn = logged ? 1 : 0; Prefs.SetInt(USER_LOGGED, loggedIn); Prefs.Save(); }
private void Draw <T>(System.Func <Rect, T, T> DrawField, Rect rect, System.Func <string, T> Get, System.Action <string, T> Set, string key) { var value = Get(key); var newValue = DrawField(rect, value); if (value.Equals(newValue)) { return; } Set(key, newValue); UnityPrefs.Save(); }
public void Draw(Rect rect, string key) { var value = Get(key); var newValue = DrawField(rect, value); if (value.Equals(newValue)) { return; } Set(key, newValue); UnityPrefs.Save(); }
static public void forceSave() { PlayerPrefs.Save(); }
public static void StoreAuthToken(string authToken) { Prefs.SetString(AUTHENTICATION_TOKEN, authToken); Prefs.Save(); }
public static void ResetUserAccess() { Prefs.SetInt(USER_LOGGED, 0); Prefs.SetString(USER_PROFILE, ""); Prefs.Save(); }
public static void StoreUserAccess(User user) { SetUserAccess(true); Prefs.SetString(USER_PROFILE, JsonConvert.SerializeObject(user)); Prefs.Save(); }