How to Save Objects that were added into the scene at runtime

So in most survival games, you can build and place walls, roofs and all that. Then you can save and close your game. And when you come back, your buildings are in the same place where you left them. How do I go about saving objects that were added in during runtime?

You’ll need to write some system (or buy one from the asset store) that enables you to retrieve key data from your objects, such as position / health etc, and save them out in some format (XML, JSON etc).

I answered this very question, but phrased in a different way, a couple of days ago: How do I save the game state as a new scene while playing? - Questions & Answers - Unity Discussions

You can check out my free SerializeHelper save & load utility, aimed at teaching beginners the basics of saving and loading data, while also providing a framework.

SerializeHelper - Free save and load utility. (De)Serialize all objects in your scene.