Skip to content

Commit eeaee46

Browse files
committed
fix: create save directory if missing for offline load
1 parent 7116ebd commit eeaee46

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Assets/Scripts/Util/UtilJSONFile.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ public static string[] GetSaveFiles()
1919
#else
2020
string path = Application.persistentDataPath + "/";
2121
#endif
22+
if (!Directory.Exists(path))
23+
{
24+
Directory.CreateDirectory(path);
25+
return Array.Empty<string>();
26+
}
27+
2228
var files = Directory.GetFiles(path, "*" + Settings.SaveFileSuffix);
2329
Array.Sort(files);
2430
return files;

0 commit comments

Comments
 (0)