UnityLitJson
UnityLitJson copied to clipboard
Parsing Doubles fails if current CultureInfo is using a different decimal separator.
I tried to parse a JSON in the Unity editor on Mac OS X, and it seems that the current CultureInfo is using a different decimal separator on my system. Hence, it fails to parse floating point numbers. The solution is to parse doubles with the invariant NumberFormatInfo, like it was written in JSONWriter.
I spent half a day looking for why my game doesn't work correctly on some devices. Turn out it breaks on phone using a localization different from English. And I made the same fix as yours.