This project provides JSON serialization for Unity.Mathematics types based on System.Text.Json.
dotnet add package UnityMathematics.Text.Json --version x.y.z <ItemGroup>
<PackageVersion Include="UnityMathematics.Text.Json" Version="x.y.z" />
</ItemGroup> <ItemGroup Label="dependencies">
<PackageReference Include="UnityMathematics.Text.Json" />
</ItemGroup>TBD once implementation is added.
PRs are welcome.
Please refer to COLLABORATION.md for more details.
This is the main package, supporting both array and object notation, at the expense of a slightly more convoluted design.
If your requirement is to only support a single notation style, the following standalone packages might be what you want.
The package for using only JSON Array notation, as in the example below.
{
"vector": [1.43, 2.09, 43.9]
}The package for using only JSON Object notation, as in the example below.
{
"vector": {
"x": 1.43,
"y": 2.09,
"z": 43.9
}
}