@@ -70,14 +70,14 @@ public void Save(object obj, string filename, string folder = null)
7070 folder = defaultFolder ;
7171 }
7272 var saveLoadMethod = GetSaveLoadMethod ( saveMethod ) ;
73- SaveLoadUtility . Save ( obj , saveLoadMethod , filename , folder , baseFolder ) ;
73+ SaveLoadUtility . Save ( obj , saveLoadMethod , filename , folder , baseFolder ) ;
7474 }
7575
7676 /// <summary>
7777 /// Gets the list of save files that have been created
7878 /// </summary>
7979 /// <param name="folder">sub folder</param>
80- /// <param name="extension"></param>
80+ /// <param name="extension">filter for files only with this extension if provided. Do not include the '.' in the string. </param>
8181 /// <param name="streamingAssets">Will use Application.streamingAssetsPath as base path if true otherwise Application.persistentDataPath</param>
8282 /// <returns>list of file names (excludes the path)</returns>
8383 public string [ ] GetFiles ( string folder = null , string extension = null , bool streamingAssets = false )
@@ -86,15 +86,15 @@ public string[] GetFiles(string folder = null, string extension = null, bool str
8686 {
8787 folder = defaultFolder ;
8888 }
89- return SaveLoadUtility . GetSavedFiles ( folder , baseFolder , extension , streamingAssets ) ;
89+ return SaveLoadUtility . GetSavedFiles ( folder , baseFolder , extension , streamingAssets ) ;
9090 }
9191
9292 /// <summary>
9393 /// Gets the list of save files that have been created
9494 /// </summary>
9595 /// <param name="list">list to be populated with file names</param>
9696 /// <param name="folder">sub folder</param>
97- /// <param name="extension"></param>
97+ /// <param name="extension">filter for files only with this extension if provided. Do not include the '.' in the string. </param>
9898 /// <param name="streamingAssets">Will use Application.streamingAssetsPath as base path if true otherwise Application.persistentDataPath</param>
9999 /// <returns>list of file names (excludes the path)</returns>
100100 public void GetFiles ( List < string > list , string folder = null , string extension = null , bool streamingAssets = false )
@@ -103,8 +103,23 @@ public void GetFiles(List<string> list, string folder = null, string extension =
103103 {
104104 folder = defaultFolder ;
105105 }
106-
107- SaveLoadUtility . GetSavedFiles ( list , folder , baseFolder , extension , streamingAssets ) ;
106+ SaveLoadUtility . GetSavedFiles ( list , folder , baseFolder , extension , streamingAssets ) ;
107+ }
108+
109+ /// <summary>
110+ /// Checks if a given save file
111+ /// </summary>
112+ /// <param name="filename">name of the file to be checked</param>
113+ /// <param name="folder">subfolder within the base folder if any</param>
114+ /// <param name="streamingAssets">Will use Application.streamingAssetsPath as base path if true otherwise Application.persistentDataPath</param>
115+ /// <returns>True if file exists, false otherwise</returns>
116+ public bool Exists ( string filename , string folder = null , bool streamingAssets = false )
117+ {
118+ if ( string . IsNullOrEmpty ( folder ) )
119+ {
120+ folder = defaultFolder ;
121+ }
122+ return SaveLoadUtility . Exists ( filename , folder , baseFolder , streamingAssets ) ;
108123 }
109124
110125 /// <summary>
0 commit comments