public void SaveData() { var save = slController.makeSaveData(); var binaryFormatter = new BinaryFormatter(); using (var fileStream = File.Create(savePath)) { binaryFormatter.Serialize(fileStream, save); } Debug.Log("Data saved"); }