Extended Vector2 converter to support the old Vector2D format #1396
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request resolves the "Fail to open file: The JSON value could not be converted to System.Numerics.Vector2" error that was reported during the first round of testing. The context of the reported error is scene files, though old exported camera files were also affected.
In #1385 I replaced the custom Anamnesis vector objects with System.Numerics variants. It turns out that the way the old 2D and 3D vector structs were serialized differed, and my implementation did not account for that difference (refer to the format difference below). As part of that pull request, I opted for a single format that is used for both 2D and 3D vectors, without realizing that although their "ToString" methods followed the format, Json serialization did not. This is what caused the issue this pull request aims to fix.
Old format:
New format: