Skip to content

Fixes serialization of Vectors/Quaternion with Json.Net

Notifications You must be signed in to change notification settings

DeathTBO/Unity3D-Json.Net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Json.Net Unity3D Extensions

What Is It?

This repo contains converters which fix serializing Vectors/Quaternions. Unity3D Vectors and Quaternions have properties on them which return the same type. This causes an infinite loop while Json.Net is serializing. To solve it, the converter simply writes the x/y/z/w values directly.

Do I Need To Do Anything?

Not really. The Newtonsoft.Json.Unity folder contains "ConverterInitializer.cs". This script automatically activates in the Editor when scripts are recompiled, and right before the splash screen in the player. It changes the default Json.Net settings to include the Vector and Quaternion converters. If you need to change the default settings you can include more converters there, or take out that script and initialize it manually.

Import the Unity Package into your project, and voila! Head over to Releases to get a package.

About

Fixes serialization of Vectors/Quaternion with Json.Net

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages