Example #1
0
    public void SetLockOutPref(List <int> prefs)
    {
        // Debug.Log("********************* \n IN MODEL SETTING LOCK PREFS \n*************************");

        LockOutPrefs tempStruct = new LockOutPrefs(prefs[0], prefs[1], prefs[2], prefs[3]);

        PlayerPrefs.SetString(LOCK_KEY, JsonUtility.ToJson(tempStruct));
        PlayerPrefs.Save();

        // Debug.Log("********************* \n IN MODEL LOCK VALUE IS " + PlayerPrefs.GetString(LOCK_KEY) + "\n*************************");
    }
Example #2
0
    public List <int> GetLockOutPrefs()
    {
        if (PlayerPrefs.HasKey(LOCK_KEY))
        {
            List <int>   tempList = new List <int>();
            LockOutPrefs prefs    = JsonUtility.FromJson <LockOutPrefs>(PlayerPrefs.GetString(LOCK_KEY));

            // Add all the prefs data to tempList
            tempList.Add(prefs.fromTime);
            tempList.Add(prefs.toTime);
            tempList.Add(prefs.fromSelection);
            tempList.Add(prefs.toSelection);

            return(tempList);
        }

        return(null);
    }