Elegant Saving and Loading solutions

Hey friends, I’m looking to throw a scenario out there and gather some solutions. As far as I know, I’m caught up on the basics of saving and loading stuff thru PlayerPrefs. This is my scenario:

Let’s say a player comes into a level and interacts with a box. The box changes colors or what ever. Does what it’s suppose to do. The player leaves the level but comes back to the level.

I’d like the box to remember it has been interacted with and remember the state that it was in when the player comes back to it’s level. My immediate thought is to save some sort of bool variable in the PlayerPrefs that’s checked when the particular level is loaded.

This to me seems rudimentary. And maybe it is, and its the best and only way to accomplish this. I’m unsure. I just wanted to see if there is something I am unaware of or a solution that more elegant than brute force writing if then statements for hundreds and hundreds of individual game objects.

Any thoughts would be greatly appreciated!

Elegant and PlayerPrefs aren’t 2 words I’d put together.

PlayerPrefs are for preferences… not game saves. They’re for saving minor settings/preferences across games.

Welp, so I am not caught up.

What about the scenario? I’m still considering creating a large list of bool variables that an individual object checks each time it’s particular level is loaded.

Am I missing anything in that regard?

This could be of some use to you, persistence of data.

Surely they’re for whatever you want. I use them for game save data. I use classes for my save which I serialise to json and store as strings in PlayerPrefs. It works fine for my purposes.

I’ve been playing around with ScriptableObjects recently which have helped with my data persistence problems.

Worth taking a look: