Converters of common Unity types for Newtonsoft.Json. Goes hand in hand with jilleJr/Newtonsoft.Json-for-Unity
Fixed converter lookups collisions when multiple assemblies converters with the same name, as it was not resolving assemblies in an exact way nor deterministic order:
Added assembly name field to ConverterConfig
for each converter.
Changed TypeCache to sort assemblies based on FullName
and some heuristics.
Changed TypeCache to lookup type in correct assembly, based on the assembly's name.
Fixed typo in the new Unity.Mathematics QuaternionConverter's namespace: from Newtonsoft.Json.UnityConverters.Math.QuaternionConverter
to Newtonsoft.Json.UnityConverters.Mathematics.QuaternionConverter
(Math
→ Mathematics
). (#87)
Fixed compilation error when using Unity.Mathematics with Newtonsoft.JSON v10. (#87)
Fixed UnityConvertersConfigEditor scriptable object asset throwing error after recompiling scripts in Unity 2022.3.0 when selected and shown in inspector. (#82)
Thanks @EpsilonD3lta for the implementation (#83)
Added converters for Unity.Mathematics. This includes all the float2
, double3
, int4
, bool4
, and similar types. (#80)
There are no custom converters for the matrix types (float2x2
, float2x3
, etc), as they currently work out-of-the-box.
Added ResolutionConverter
to be able to read JSON from older Unity versions. (#79)
Fixed compilation errors when targeting .NET Standard 2.1. (#79)
Fixed converter types taking long time to load, sometimes causing lag spikes each time assembly got reloaded (especially when entering play-mode).
The issue was that this package tries to find all converters by looping through all types in all assemblies.
You should see better performance now, as we are using more optimized code paths and making use of Unity's TypeCache.
If your project still suffers from big lag spikes, then you can opt-out completely of the "auto type scanning" code via the settings found at "Edit > Json.NET converters settings..." (#79)
[Preserve]
attribute to the entire assemblies. (#73)Added support for UnityEngine.AddressableAssets.AssetReference
. The new AssetReferenceConverter
is only included in the build if your project contains the com.unity.addressables
package. (#66, #67)
This automatic inclusion relies on AssemblyDefinition version defines, which was introduced in Unity 2019.1.x. To enable the AssetReferenceConverter
in earlier versions of Unity, please add HAVE_MODULE_ADDRESSABLES
to your project's "Scripting Define Symbols" found in the "Project Settings" -> "Player" -> "Other Settings" panel.
Changed the following modules to be automatically excluded from compilation if they are not used in the project:
com.unity.modules.ai
via new define HAVE_MODULE_AI
com.unity.modules.physics
via new define HAVE_MODULE_PHYSICS
com.unity.modules.physics2d
via new define HAVE_MODULE_PHYSICS2D
This is active starting with Unity 2019.1.x. The regarded modules are always active in prior Unity versions.
Thanks @SolidAlloy for the implementation (#60)
StringEnumConverter
&
VersionConverter
) not being loaded even if you had then enabled in the
Newtonsoft.Json-for-Unity.Converters config.
(#55)