Example #1
0
 /// <summary>
 /// Don't need SaveSystemAlt.StartWork(); and SaveSystemAlt.StopWorkAndClose();
 /// Saving 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 void SetArray <T>(string key, T[] array)
 {
     if (array == null)
     {
         if (useDebug)
         {
             Debug.LogError("Array is null");
         }
         return;
     }
     string[] save = new string[1];
     save[0] = JsonHelper.ToJson(array, true);
     FilesSet.SaveStream("SaveSystemSL/Arrays/", "Array_" + key, "slsave", save, true);
 }
Example #2
0
        /// <summary>
        /// Alternative to StopWorkAndClose() in which you do not need to call StartWork() again to Get or Set data
        /// Like PlayerPrefs.Save()
        /// Don't call StartWork() after this function, use first StopWorkAndClose()
        /// </summary>
        public static void SaveUpdatesNotClose()
        {
            if (ss_sl == null)
            {
                if (useDebug)
                {
                    Debug.LogError("You're not starting the work with SaveSystemAlt");
                }
                return;
            }
            string[] save = new string[1];
            save[0] = JsonUtility.ToJson(ss_sl, true);

            FilesSet.SaveStream("SaveSystemSL/", "Save" + sindex_sl, "slsave", save, true);
        }