glTF-CSharp-Loader
glTF-CSharp-Loader copied to clipboard
Switch to System.Text.Json + inheritance
Not sure if there's any interest in taking this change, but hey, its here for anyone who needs it :)
Notes:
- The library is now compatible with trimming & NativeAOT
- Added actual inheritance support instead of inserting the same base members (e.g name, extensions, extra) in every type. The base types (e.g
GltfChildOfRootProperty) were always generated, but weren't used. - Minimum target is now .netstandard2.0 (was 1.3)
- There's no automatic
ShouldSerializeXXhandling in STJ, so so default value handling is registered through generated code -
JsonStringEnumConverterWithEnumMemberAttrSupportis required to allow custom serialized enum names. Preview version of STJ 8 is needed to make this trim safe. - Removed
ArrayConverter- See the commit message from when it was added. https://github.com/KhronosGroup/glTF-CSharp-Loader/commit/90932db7e3cee8c2d914099aaa7d3fb8c028ee90. I'm sure this is a leftover from glTF 1.0 or something
- Removed run-on-build from Generator.csproj (another legacy thing)
Resolves https://github.com/KhronosGroup/glTF-CSharp-Loader/issues/50 Closes https://github.com/KhronosGroup/glTF-CSharp-Loader/issues/28
Thank you for this contribution. As a user I would definitely want your PR to be merged. I tested it locally and it works wonderfully. Not depending on Newtonsoft for JSON parsing is a huge improvement in my opinion. I've also noticed slightly lower loading times.