I currently am working on a game where we need to switch scenes. However, whenever I do so, all the instantiated prefabs and items in the list from the scene that I switched from are deleted as well as some values stored in primitive variables. I figured out how to save the primitive variables with PlayerPrefs. Is there any way to do the same with lists? Is there a way to save the scene as it is with the instantiated prefabs? Thanks so much for your help!
There’s a tutorial here on persistence:
If you want to save a list in PlayerPrefs, you have to break it up into individual variables, and then pick them up and fill the list again.
There is also a json utility for saving data.
If you want to save between scenes, you can use DontDestroyOnLoad.
That tutorial is out of date and so is much of the stuff that gets posted up, please check out this thread I made on the topic awhile ago, it should help you, there’s JSON and XML in there and people were very helpful in answering my questions.