// Dust public static bool[] GetTabDust2(float totalDust) { ScriptDustItemsContainer2 temp = new ScriptDustItemsContainer2 (); temp = ScriptDustItemsContainer2.LoadDust (DustReadFileName2); bool[] tabDust = new bool[(int)totalDust]; if (temp != null) { int i = 0; foreach (ScriptDustItems2 item in temp.Items) { tabDust [i] = item.Dustcollected; i++; } return tabDust; } else { for (int i = 0; i < totalDust; i++) { tabDust[i] = false; } return tabDust; } }
public void SetTabDust2(bool[] tempTab, int tailleTab) { ScriptDustItemsContainer2 save = new ScriptDustItemsContainer2 (); ScriptDustItems2 saveItem ;//= new ScriptDustItems (); for (int i=0; i< tailleTab; i++) { saveItem = new ScriptDustItems2 (); saveItem.Dustcollected = tempTab[i]; save.Items.Add(saveItem); } save.WriteDust2(DustWriteFileName2); }