SebLague / Geographical-Adventures

https://sebastian.itch.io/geographical-adventures
MIT License
3.37k stars 486 forks source link

Problem with Stars data [Resolved] #12

Closed LwRed closed 2 years ago

LwRed commented 2 years ago

Hello, i have this error message in StarLoader.cs (i'm on Windows)

FormatException: Input string was not in a correct format. System.Number.ParseSingle (System.String value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.Single.Parse (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.Single.Parse (System.String s) (at <695d1cc93cca45069c528c15c9fdd749>:0) StarLoader.LoadStars () (at Assets/Scripts/Game/Solar System/StarLoader.cs:33) StarRenderer.Start () (at Assets/Scripts/Game/Solar System/StarRenderer.cs:31)

Seems that PC version on itch.io doesn't show stars, but i didn't try mac or linux versions

LwRed commented 2 years ago

ok, i resolved the problem

In StarLoader.cs

using System.Globalization;

and then

float magnitude = float.Parse(values[13], CultureInfo.InvariantCulture); float rightAscension = float.Parse(values[7], CultureInfo.InvariantCulture); float declination = float.Parse(values[8], CultureInfo.InvariantCulture);

LwRed commented 2 years ago

I let you close, sorry