Ahh yes, I see, I have to take what’s in GameState and save it inside of Saves.
The thing I’m struggling with is HOW to do that…
According to this post, it can be done with JSON. In that case…
Do I need to use JSON to move the values to another variable, and THEN save them in Saves?
What I’m trying to do in the above code:
- Use JSON to move the values from GameState to Saves.Save(CurrentSaveSlot) in this case, a.
- Save the entire Saves structure.
- Immediately load the entire Saves structure, and parse the loaded JSON so that the text updates dynamically.
When I tried it this way, it didn’t work. The debugger shows that it’s just creating a new structure in the Saves structure instead of saving it in the selected slot. The error says that it’s unable to parse the values too.
I can’t use the ToString you suggested because it still gives me an error when it’s typed.
I’m aware WHAT I have to to, but I have no idea HOW to do it, or what events I have to use to accomplish it. Is using JSON to move the structure correct?