public static temp_collection LoadSaveData() { if (!File.Exists(Path)) { Debug.Log("path dosent exist"); return(null); } else { Debug.Log("path exist"); } BinaryFormatter formatter = new BinaryFormatter(); FileStream stream = new FileStream(Path, FileMode.Open); temp_collection data = formatter.Deserialize(stream) as temp_collection; stream.Close(); data.temp_collection_load(); Debug.Log("loaded data"); return(data); }
public static void saveData(temp_collection tempc) { Debug.Log(Path); BinaryFormatter formatter = new BinaryFormatter(); Path = Application.persistentDataPath + "/collection_Savedata.txt"; FileStream stream = new FileStream(Path, FileMode.OpenOrCreate); formatter.Serialize(stream, tempc); stream.Close(); }
public void save_cards() { //load cards // static_collections.Deaks.Clear(); static_collections.Deaks = deaks; for (int i = 0; id.Length > i; i++) { static_collections.Collection[i] = Collection[i].count; } temp_collection tmpc = new temp_collection(); tmpc.temp_collection_save(); }
public void PurcahseTheCards() { cardcost = 250; if (FakeMicrotransactions.staticIngameCoins >= cardcost) { FakeMicrotransactions.staticIngameCoins -= cardcost; for (int i = 0; 6 < i; i++) { static_collections.Collection[Random.Range(0, 151)] += 1; } temp_collection x = new temp_collection(); x.temp_collection_save(); collection.load_cards(); } else { Debug.Log("comeback when you get some more money"); } }
public void PurcahseTheCards() { cardcost = 250; if (FakeMicrotransactions.staticIngameCoins >= cardcost) { FakeMicrotransactions.staticIngameCoins -= cardcost; for (int i = 0; 6 > i; i++) { int a = Random.Range(0, 151); static_collections.Collection[a] += 1; print(a.ToString()); } temp_collection x = new temp_collection(); x.temp_collection_save(); collection.load_cards(); responce.text = "yes... yes... come again"; } else { responce.text = "comeback when you get some more money"; } }