I'm trying to create a game for a school project with the use of C#. Basically, it is an idle game but you earn through quizzes. I'm almost done but I have one problem. I have already created a save system for all the data I want to store through text files. However, I don't know how to save the UI "data'. By "UI Data", I mean when a button has become inaccessible already because the upgrade has been maxed, How do I save that? Basically, I want to save the state of the UI objects when I leave the game then load it again when opening. Example, the player already maxed an upgrade. Whenever I load the game again, the user would be able to buy that upgrade and it is easily exploitable. You can just max the upgrade, earn, close the game, and spam that cheap upgrade. What is the way around this? Thanks.
Your save should only save game data state, such as if something is maxed out, NOT what is presented in the UI. Proper UI just follows the game data at any given point in time. When you reload the game, the UI should be properly set up to reflect the state of that data. Any other halfway-data halfway-UI save scheme is going to prove VERY hard to maintain and debug.
So you know for the future, this is the 2D forum where you should post 2D related issues and questions. More appropriate dedicated forums are available such as Scripting and UI. Thanks and good luck with your projects.