Exemple #1
0
    private static void SetUserAccess(bool logged)
    {
        int loggedIn = logged ? 1 : 0;

        Prefs.SetInt(USER_LOGGED, loggedIn);
        Prefs.Save();
    }
Exemple #2
0
        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();
        }
Exemple #3
0
            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();
            }
Exemple #4
0
 static public void forceSave()
 {
     PlayerPrefs.Save();
 }
 public static void StoreAuthToken(string authToken)
 {
     Prefs.SetString(AUTHENTICATION_TOKEN, authToken);
     Prefs.Save();
 }
Exemple #6
0
 public static void ResetUserAccess()
 {
     Prefs.SetInt(USER_LOGGED, 0);
     Prefs.SetString(USER_PROFILE, "");
     Prefs.Save();
 }
Exemple #7
0
 public static void StoreUserAccess(User user)
 {
     SetUserAccess(true);
     Prefs.SetString(USER_PROFILE, JsonConvert.SerializeObject(user));
     Prefs.Save();
 }