Skip to content

Commit f2f1ab4

Browse files
author
Cory Leach
committed
Fixing get path issue where the wrong save folder could end up in the path
1 parent 2d80151 commit f2f1ab4

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

Diff for: README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
</p>
99
<h1 align="center">Gameframe.SaveLoad 👋</h1>
1010
11+
<!-- BADGE-START ->
12+
<img align="center" src="https://raw.githubusercontent.com/coryleach/UnityPackages/master/Documentation/GameframeFace.gif" />
13+
</p>
14+
<h1 align="center">Gameframe.SaveLoad 👋</h1>
15+
1116
<!-- BADGE-START -<!-- BADGE-END -->
1217

1318
Serialization helper utility that supports save, load and encryption.
@@ -17,15 +22,15 @@ Serialization helper utility that supports save, load and encryption.
1722
#### Using UnityPackageManager (for Unity 2019.3 or later)
1823
Open the package manager window (menu: Window > Package Manager)<br/>
1924
Select "Add package from git URL...", fill in the pop-up with the following link:<br/>
20-
https://github.com/coryleach/UnitySaveLoad.git#1.0.9<br/>
25+
https://github.com/coryleach/UnitySaveLoad.git#1.0.10<br/>
2126

2227
#### Using UnityPackageManager (for Unity 2019.1 or later)
2328

2429
Find the manifest.json file in the Packages folder of your project and edit it to look like this:
2530
```js
2631
{
2732
"dependencies": {
28-
"com.gameframe.saveload": "https://github.com/coryleach/UnitySaveLoad.git#1.0.9",
33+
"com.gameframe.saveload": "https://github.com/coryleach/UnitySaveLoad.git#1.0.10",
2934
...
3035
},
3136
}

Diff for: Runtime/SaveLoadManager.cs

+7-3
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,16 @@ public T Copy<T>(T obj)
144144
/// Get the full path to a save file
145145
/// </summary>
146146
/// <param name="filename">Name of file</param>
147-
/// <param name="folderName">Name of folder containing file</param>
147+
/// <param name="folder">Name of folder containing file</param>
148148
/// <param name="streamingAssets">true if saves are from streaming assets</param>
149149
/// <returns>full path to the file on disk</returns>
150-
public string GetPath(string filename, string folderName = null, bool streamingAssets = false)
150+
public string GetPath(string filename, string folder = null, bool streamingAssets = false)
151151
{
152-
var savePath = SaveLoadUtility.GetSavePath(folderName, baseFolder, streamingAssets);
152+
if (string.IsNullOrEmpty(folder))
153+
{
154+
folder = defaultFolder;
155+
}
156+
var savePath = SaveLoadUtility.GetSavePath(folder, baseFolder, streamingAssets);
153157
var saveFilename = savePath + filename;
154158
return saveFilename;
155159
}

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.gameframe.saveload",
33
"displayName": "Gameframe.SaveLoad",
4-
"version": "1.0.9",
4+
"version": "1.0.10",
55
"description": "Serialization helper utility that supports save, load and encryption.",
66
"keywords": [],
77
"author": {

0 commit comments

Comments
 (0)