From f2f1ab4b7a86cbe4d63d7d8512b01e6064f94547 Mon Sep 17 00:00:00 2001 From: Cory Leach Date: Fri, 17 Nov 2023 17:20:25 -0600 Subject: [PATCH] Fixing get path issue where the wrong save folder could end up in the path --- README.md | 9 +++++++-- Runtime/SaveLoadManager.cs | 10 +++++++--- package.json | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9b0fd86..0ee14d9 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,11 @@

Gameframe.SaveLoad 👋

+ Serialization helper utility that supports save, load and encryption. @@ -17,7 +22,7 @@ Serialization helper utility that supports save, load and encryption. #### Using UnityPackageManager (for Unity 2019.3 or later) Open the package manager window (menu: Window > Package Manager)
Select "Add package from git URL...", fill in the pop-up with the following link:
-https://github.com/coryleach/UnitySaveLoad.git#1.0.9
+https://github.com/coryleach/UnitySaveLoad.git#1.0.10
#### Using UnityPackageManager (for Unity 2019.1 or later) @@ -25,7 +30,7 @@ Find the manifest.json file in the Packages folder of your project and edit it t ```js { "dependencies": { - "com.gameframe.saveload": "https://github.com/coryleach/UnitySaveLoad.git#1.0.9", + "com.gameframe.saveload": "https://github.com/coryleach/UnitySaveLoad.git#1.0.10", ... }, } diff --git a/Runtime/SaveLoadManager.cs b/Runtime/SaveLoadManager.cs index 2700177..274b45e 100644 --- a/Runtime/SaveLoadManager.cs +++ b/Runtime/SaveLoadManager.cs @@ -144,12 +144,16 @@ public T Copy(T obj) /// Get the full path to a save file /// /// Name of file - /// Name of folder containing file + /// Name of folder containing file /// true if saves are from streaming assets /// full path to the file on disk - public string GetPath(string filename, string folderName = null, bool streamingAssets = false) + public string GetPath(string filename, string folder = null, bool streamingAssets = false) { - var savePath = SaveLoadUtility.GetSavePath(folderName, baseFolder, streamingAssets); + if (string.IsNullOrEmpty(folder)) + { + folder = defaultFolder; + } + var savePath = SaveLoadUtility.GetSavePath(folder, baseFolder, streamingAssets); var saveFilename = savePath + filename; return saveFilename; } diff --git a/package.json b/package.json index b0b9698..3a28a2f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.gameframe.saveload", "displayName": "Gameframe.SaveLoad", - "version": "1.0.9", + "version": "1.0.10", "description": "Serialization helper utility that supports save, load and encryption.", "keywords": [], "author": {