feat: update Godot integration and coordinated package dependencies
This commit is contained in:
11 files changed
+525
-49
No files matched your search
@@ -33,8 +33,28 @@ namespace ShrinkDataSaver
|
||||
if (string.IsNullOrWhiteSpace(rootPath))
|
||||
throw new InvalidOperationException("ShrinkDataSaver platform paths are not configured.");
|
||||
var storage = new LocalStorageProvider(rootPath);
|
||||
ShrinkSettings.Initialize(storage, System.IO.Path.Combine(rootPath, settingsFileName));
|
||||
ShrinkSave.Initialize(storage, System.IO.Path.Combine(rootPath, "saves"), saveFileExtension, currentSaveVersion);
|
||||
Initialize(storage, rootPath, saveFileExtension, settingsFileName, currentSaveVersion);
|
||||
}
|
||||
|
||||
public static void Initialize(IStorageProvider storage, string? rootPath = null,
|
||||
string saveFileExtension = ".json", string settingsFileName = "settings.json",
|
||||
int currentSaveVersion = 1)
|
||||
{
|
||||
if (storage == null)
|
||||
throw new ArgumentNullException(nameof(storage));
|
||||
|
||||
rootPath ??= Paths?.PersistentDataPath;
|
||||
#if UNITY_5_3_OR_NEWER
|
||||
rootPath ??= UnityEngine.Application.persistentDataPath;
|
||||
#endif
|
||||
var settingsPath = string.IsNullOrWhiteSpace(rootPath)
|
||||
? settingsFileName
|
||||
: System.IO.Path.Combine(rootPath, settingsFileName);
|
||||
var savesDir = string.IsNullOrWhiteSpace(rootPath)
|
||||
? "saves"
|
||||
: System.IO.Path.Combine(rootPath, "saves");
|
||||
ShrinkSettings.Initialize(storage, settingsPath);
|
||||
ShrinkSave.Initialize(storage, savesDir, saveFileExtension, currentSaveVersion);
|
||||
}
|
||||
|
||||
internal static double TimeSeconds
|
||||
|
||||
Reference in new issue
Block a user