private void Start() { SaveList saveList = GetSave(); UpdateSave(saveList); SaveData(saveList); }
private void UpdateSave(SaveList savescore) { foreach (Transform child in holder) { Destroy(child.gameObject); } foreach (SaveStruct s in savescore.SongSaveList) { Instantiate(SongBoject, holder).GetComponent <SaveInitalise>().Initalise(s); } }
public static void SaveData(SaveList SaveData) { BinaryFormatter formatter = new BinaryFormatter(); FileStream stream = new FileStream(SavePath, FileMode.Create); formatter.Serialize(stream, SaveData); stream.Close(); //using (StreamWriter stream = new StreamWriter(SavePath)) //{ // new JsonSerializer().Serialize(stream, SaveData); //} }
public static void StoreData(string songName, string imageName) { SaveList saveList = SaveSystem.Save.GetSave(); SaveStruct temp = new SaveStruct(); temp.songName = songName; temp.imageName = imageName; temp.Line_1 = EditNode.Line_1; temp.Line_2 = EditNode.Line_2; temp.Line_3 = EditNode.Line_3; temp.Line_4 = EditNode.Line_4; temp.Line_5 = EditNode.Line_5; temp.Line_6 = EditNode.Line_6; temp.Line_7 = EditNode.Line_7; temp.Line_8 = EditNode.Line_8; temp.Line_9 = EditNode.Line_9; saveList.SongSaveList.Add(temp); SaveSystem.Save.SaveData(saveList); }