Data roundup
Every individual module and topic we’ve covered in this chapter can be used by itself or combined to suit your project’s needs. For example, you could use text files to store character dialog and only load it when you need to. This would be more efficient than having the game keep track of it every time it runs, even when the information isn’t being used.
You could also put character data or enemy statistics into either an XML or JSON file and read from the file anytime you need to level up a character or spawn a new monster. Finally, you could fetch data from a third-party database and serialize it into your own custom classes. This is a super common scenario with storing player accounts and external game data.
You can find a list of data types that can be serialized in C# at: https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/types-supported-by-the-data-contract-serializer. Unity handles serialization a little differently...