Saving, Loading, and Serializing Data
Every game you've ever played works with data, whether it's your player stats, game progress, or online multiplayer scoreboards. Your favorite game also manages internal data, meaning the programmers used hardcoded information to build levels, keep track of enemy stats, and write helpful utilities. In other words, data is everywhere.
In this chapter, we're going to start with how both C# and Unity handle the filesystem on your computer, and move on to reading, writing, and serializing our game data. Our focus is on working with the three most common data formats you'll likely come across: text files, XML, and JSON.
By the end of this chapter, you'll have a foundational understanding of your computer's filesystem, data formats, and basic read-write functionality. This will be the foundation you build your game data on, creating a more enriching and engaging experience for your players. You'll also be in...