public static void Save(GameData _data, string _fileName) {
string filePath = Path.Combine(Application.persistentDataPath, _fileName);
//Debug.Log(Path.Combine(Application.persistentDataPath, _fileName));
BinaryFormatter binaryFormatter = new BinaryFormatter();
FileStream fileStream = new FileStream(filePath, FileMode.Create);
binaryFormatter.Serialize(fileStream, _data);
fileStream.Close();
}
^ There's my code that serializes one of my classes into binary... but when I browse to that binary file and open it in notepad... it looks like this...
{"strength":-3,"defense":-3,"speed":-3}
Am I crazy? That doesn't look like binary... more like... JSON... ???? 0_o
↧