Example #1
0
 /// <summary>
 /// Don't need SaveSystemAlt.StartWork(); and SaveSystemAlt.StopWorkAndClose();
 /// Loading array with key, use only English
 /// Don't use this on Update or FixedUpdate
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="key">Name to save</param>
 /// <param name="array">Any array to save</param>
 public static T[] GetArray <T>(string key)
 {
     if (FilesSet.CheckFile("SaveSystemSL/Arrays/", "Array_" + key, "slsave", true))
     {
         if (useDebug)
         {
             Debug.LogError("Key not exist");
         }
         return(null);
     }
     else
     {
         return(JsonHelper.FromJson <T>(EasyDo.GetWWWString(Application.persistentDataPath + "/SaveSystemSL/Arrays/Array_" + key + ".slsave")));
     }
 }
Example #2
0
        /// <summary>
        /// Initialize this before you start working with SaveSystemAlt (SSA) in your code
        /// </summary>
        /// <param name="i">Index of SSA</param>
        public static void StartWork(int i = 0)
        {
            if (!(ss_sl == null) && useDebug)
            {
                Debug.LogError("Warning, you haven't closed old save");
            }

            ss_sl     = new SaveSystemSL();
            sindex_sl = i;
            if (FilesSet.CheckFile("SaveSystemSL/", "Save" + sindex_sl, "slsave", true))
            {
                if (useDebug)
                {
                    Debug.Log(FilesSet.LoadStream("SaveSystemSL/", "Save" + sindex_sl, "slsave", true, false));
                }
                ss_sl = JsonUtility.FromJson <SaveSystemSL>(FilesSet.LoadStream("SaveSystemSL/", "Save" + sindex_sl, "slsave", true, false));
            }
        }