public void SaveSession() { try { ItemCollectionSerializer ics = new ItemCollectionSerializer(ItemList); ics.Save(ContainerPath); } catch (Exception e) { } }
public void RestoreLastSession() { ItemCollectionSerializer ics = new ItemCollectionSerializer(); paramses = ics.Load(ContainerPath); ItemList.Clear(); foreach (Transform t in SlotList) { foreach (Transform i in t) { Destroy(i.gameObject); } } foreach (ItemDataParams i in paramses) { AddItem(i.ID, i.Amount, i.slotID); } }
public void RestoreLastSession() { ItemCollectionSerializer ics = new ItemCollectionSerializer(); paramses = ics.Load(ContainerPath); ItemList.Clear(); foreach (Transform t in SlotList) { foreach (Transform i in t) { Destroy(i.gameObject); } } foreach (ItemDataParams i in paramses) { AddItem(i.ID, i.Amount,i.slotID); } }