In 2018 I could float.Parse(“1.5”), which would give me a 1.5f.
In 2019.1.0b8 it returns 15.
I guess it’s the system localization (working on a German Windows 10), but I’m not sure.
How can I deactivate it and make sure no scripts will ever deviate from English behavior no matter what language/region a player’s OS is?
I’m not even sure what kind of things are affected by this forced localization besides number conversion. Is there any list?
@Carpe-Denius is right. It is a change in the .net framework introduced in 4.x. You can set CultureInfo.CurrentCulture = CultureInfo.InvariantCulture; at the start of the app or use float aValue = float.Parse("1.5", CultureInfo.InvariantCulture); . We fixed it in the editor wherever serialization was involved.
@bobdonovan@Carpe-Denius
Thanks.
How do I make sure it’s at the start of the app? Just have some script and put it on the top of execution order or something else?