예제 #1
0
 public static void LoadExStorageDepotData()
 {
     QuickLogger.Info("Loading Save Data...");
     ModUtils.LoadSaveData <ExStorageDepotSaveData>(SaveDataFilename, GetSaveFileDirectory(), (data) =>
     {
         _exStorageDepotSaveData = data;
         QuickLogger.Info("Save Data Loaded");
         OnExStorageDepotLoaded?.Invoke(_exStorageDepotSaveData);
     });
 }
예제 #2
0
        public static void SaveExStorageDepot()
        {
            if (!IsSaving())
            {
                _saveObject = new GameObject().AddComponent <ModSaver>();

                ExStorageDepotSaveData newSaveData = new ExStorageDepotSaveData();

                var storages = GameObject.FindObjectsOfType <ExStorageDepotController>();

                QuickLogger.Debug($"Storages count {storages.Length}");

                foreach (var storage in storages)
                {
                    storage.Save(newSaveData);
                }

                _exStorageDepotSaveData = newSaveData;

                ModUtils.Save <ExStorageDepotSaveData>(_exStorageDepotSaveData, SaveDataFilename, GetSaveFileDirectory(), OnSaveComplete);
            }
        }