void LoadMemoryFromPref() { if (!PlayerPrefs.HasKey("memories")) { PlayerPrefs.SetString("memories", ""); } foreach (Transform child in CardList.transform) { Destroy(child.gameObject); } string memoriesString = PlayerPrefs.GetString("memories"); string[] extractedData = Shuffle(memoriesString.Split('|')); foreach (string memoryString in extractedData) { MemoryItem memory = MemoryItem.createFromString(memoryString); if (memory != null) { Instantiate(Card, CardList.transform).GetComponent <MemCard>().Initialize(memory.title, memory.detail, memory.subDetail); } } }