Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
kalle (jag) edited this page Dec 19, 2019 · 16 revisions

Welcome to the Newtonsoft.Json-for-Unity wiki!

Logo

About this repository

Json.NET is a popular high-performance JSON framework for .NET

This repo is a fork of Newtonsoft.Json containing custom builds for regular standalone, but more importantly AOT targets such as all IL2CPP builds (WebGL, iOS, Android, Windows, Mac OS X) and portable .NET (UWP, WP8).

Available for installation with

  • Unity Package Manager (UPM) recommended
  • UniGet (coming soon)
  • Unity Asset packages (coming soon)
  • Unity Asset Store (coming soon)
  • NuGet package (coming soon)

About this wiki

This Wiki is for this repository, Newtonsoft.Json-for-Unity, and will not contain pages with how-to lists that solely aim at the official Newtonsoft.Json by JamesNK.

What you'll find here

  • ✔ Installation guide into your Unity project, via UPM, UniGet, UnityPackage, and the Assets Store. Coming soontm
  • ✔ How to update the package, via UPM, UniGet, UnityPackage, and the Assets Store. Coming soontm
  • 🕓 Guides how to serialize/deserialize Unity objects (GameObject, Vector3, Scenes, et.al) //todo
  • 🕓 Using Newtonsoft.Json in your own class library you've imported into Unity. //todo
  • 🕓 Using third party dependencies (DLLs) inside Unity that themselves use Newtonsoft.Json. //todo

What you won't find here

  • ❌ Guides and help about how to serialize/deserialize using Newtonsoft.Json
  • ❌ What's the difference between the names Newtonsoft.Json and Json.NET?
  • ❌ Game development tutorials
  • How to make a fortune with Bitcoins (₿) in 5 easy steps 🤪

To receive info about one of these topics I'm omitting from this wiki, visit one of the official Json.NET links below:

Alternative solutions

Using 2017.* or below? Here are some alternative projects that may suffice for your Unity project:

But why another solution

SaladLab and ParentElement, among other unmentioned coders, have done great work in making Json.NET work in Unity. So why do we need mine?

Both mentioned projects are discontinued, and outdated by some margin in result. SaladLab's latest release targets Json.NET 9, and ParentElement's Json.NET 8. We're at Json.NET 12 now! (at time of writing)

Changeset, compared to SaladLabs and ParentElements solutions:

  • Json.NET version 12 (let's see how long I can keep up with James repo)
  • Release available via Unity Package Manager
  • Unit testing in Unity Editor
  • Unit testing in IL2CPP built platforms (ex: StandaloneWindows)

A rework is in this case easier than jumping into SaladLabs project to update it. Sorry Salad champ.

Although, in the future this may also be old stuff too, with the upcoming new System.Text.Json namespace and need to keep the project up-to-date with Newtonsoft.Json. But not for now!

Alternative, non-Newtonsoft.Json solutions

I (jilleJr) will wear this project with pride, but not enough to ignore the other amazing works done by others.

While my repo will live for some time, for future reference here are some good alternatives (that all work in Unity) that I personally recommend if my solution dips below your expectations:

Of course I want my project to get better, so please create a GitHub issue on jilleJr/Newtonsoft.Json-for-Unity when you have some troubles or want a new feature.

Happy Json parsing!