I’m trying to make a thing where you click a button, and it generates a sentence from a list of strings. Currently, I have a RemoveAt() so that the list does not repeat:
public void RevealPrompt()
{
if (entries.Count.Equals(0))
{
generate.SetActive(false);
entryText.text = "You have read all messages.";
Debug.Log("List empty.");
}
int index = Random.Range(0, entries.Count);
string randomPrompt = entries[index];
entryText.text = randomPrompt;
entries.RemoveAt(index);
}
This works okay since I only have 5 sentences that I use for testing, but the actual thing will have way more. As such, I would really like it if I can save the list after each generation, so that when the game is reloaded, the prompts that were already removed remain gone until the player gets to read all the sentences in the list and they get the “You have read all messages”.
I’m sure this would probably involve a Save Manager of some kind, but I’m not sure how to go about it. Any help would be appreciated!