public static void SaveSellersDatas(List <ShopWithShopParameters> allShopsParameters) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/shopDatas.data"; FileStream stream = new FileStream(path, FileMode.Create); SellersData data = new SellersData(); data.SetSellersData(allShopsParameters); formatter.Serialize(stream, data); stream.Close(); }
//ne pas oublier d'assigner les sellers data au SetUp public void SaveShopParameters(ShopWithShopParameters parameters) { SellersData sellersData = PlayerDataSaver.LoadShopDatas(); if (sellersData != null) { sellersData.SetSellersData(parameters); PlayerDataSaver.SaveSellersDatas(sellersData); } else { SaveAllShopsDatas(); } }