I have a save function that for some reasons brings up a Compile error.
public static void saveProgress(string saveName){
BinaryFormatter bf = new BinaryFormatter ();
string tempString = Application.persistentDataPath + "/" + saveName + ".dat";
FileStream fs = File.Create(tempString, FileMode.Create);
bf.Serialize (fs, GameState.getInstance());
fs.Close ();
}
The error message I get is this:
**Assets/SaveGame.cs(22,38): error CS1502: The best overloaded method match for `System.IO.File.Create(string, int)’ has some invalid arguments
**
But it’s strange because I’m passing in a string and what I assume to be an int in the from of FileMode.Create. Any help would be greatly appreciated.