Press "Enter" to skip to content

Tag: serialization

Data Serialization Part 2 – Unity3D, Json.NET, and Twitter REST API

Why Json.NET? Unity does now include a Json utility, but it falls flat in many cases. It doesn’t serialize nested classes well (classes with multiple levels of inheritance), it can’t rename the Json object’s variables to something more appropriate for your code base, and there’s really not a lot of options. However, it does claim to be “…significantly faster than popular .NET JSON solutions…”. One of my favorite features of Json.NET is that it can easily serialize private fields and public fields with private setters. This allows for maintaining access restriction in you code base’s models without requiring the use…

Loading

Leave a Comment

Saving Data in Unity 3D (Serialization for Beginners)

With games we almost always need to save some data: scores, inventory, progress, preferences, etc. There are many ways to do this in Unity. In this article I’ll take you through a few different ways to save data and hopefully encourage some good habits when structuring your applications for saved data. There are two main levels of persistency for data: Session Data (data doesn’t necessarily need to be remembered the next time you load up the application): This is usually done via static variables and is used for only values that matter for the current session. Most commonly this is for…

Loading

11 Comments