Saving data within a game is very important, which can be seen in just about every game out there. There is all kinds of data that you might want to keep track of, not only for yourself, but also for the player. The player's inventory, enemies' position, the player's statistics, and a lot more can be saved and loaded from a file that you create. In Unity, there are several ways to save data that you can choose from. Earlier in this book, we already went over how to use
PlayerPrefs to save and load data. In this chapter, you will learn how to use XML and custom flat files, and then create a way to activate your saving and loading processes.
In this chapter, you will: