I have a AoT Dictionary called AlphabetWidth that I fill with data I generate when my game starts. I mark this variable as "saved", as described here
I generate the dictionary data inside of a GameObject that I call, "Dictionary Generator". My ideal workflow would be:
- Turn on Dictionary Generator once, and run it. Now the Dictionary data is saved.
- Now I turn off the Dictionary Generator game object, since I don't need it to run anymore.
- Now when I need the Dictionary data in the future, I can just access it.
But I'm running into problems with this workflow, and am realizing it's probably because
a) I'm turning off the Dictionary Generator game object and I'm guessing that turns off the saved data inside of it
b) Because I lack a conceptual understanding of how saved variables work (researching that one now).
I am leaning towards running it once and exporting the data into CSVs, and then whenever I run the game again... using Split Strings to read it into a dictionary. Then I can easily access it. But this seems very kludge-y and I'm wondering if there's a better way.
What's the best practice for accessing saved data like this when I need it... should I just write the data into strings, and On Start... use String Split to split it into a Dictionary? Should I learn how PlayerPrefs work and put the data into there?
Or is there a simple way to access saved variables (generated in game by a game object which is later disabled) that I am missing?
1. Turn on Dictionary Generator once, and run it. Now the Dictionary data is SAVED
. What does saved means? You mean it is stored locally somewhere (the definition of saved?) or is it just assigned in your dictionary. \$\endgroup\$