What is the difference between I Formatter and JSON for inventory system in unity c#? Currently I am using binary formatter with JSON utility to store data in a database to save and load the data.
CodePudding user response:
As stated in the comments, binaryformatter can be considered outdated and should not be used if your game needs even the most basic security.
Json is a great alternative, I would personally recommend Newtonsoft as it solves most problems JSON had like handling dictionaries and etc.
Found at https://www.newtonsoft.com/json
Also there is some great extensions available here
Leverages the Newtonsoft extension API to encrypt/decrypt specific nodes at serialization time. So only the nodes that require encryption are touched, the remaining content is still human readable. This approach provides an compromise between readability/debugabaility and security.
Though you might need to get proper licensing on the encryption.