When you need to save a user's state, create a unique key for each user. This could be a user ID or username.
Use the Dictionary object to store values associated with this unique key.
When a user returns, use their unique key to fetch their saved data from the Dictionary.
To manage multiple users, you might use nested dictionaries or a JSON object where each user's data is stored under their unique key.
May I ask if a Dictionary can be permanently saved like local storage? Because whenever I close the game and reload it, the previous Dictionary data disappears. I have to add a "logout" button in the game to save the data. However, in reality, I cannot prevent players from accidentally closing the game window.