public static void SaveEconomy(EconomyManager eco) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/economy.save"; FileStream stream = new FileStream(path, FileMode.Create); EconomyData data = new EconomyData(eco); formatter.Serialize(stream, data); stream.Close(); }
public EconomyData(EconomyManager eco) { money = eco.totalMoney; expense = eco.totalExpense; totalMonsters = eco.totalMonsters; }