Browse Source

Fix #822 - Parse with CultureInvariant

master
shalliwell 5 years ago
parent
commit
299c7f81fa
  1. 5
      Assets/Fungus/Scripts/Components/Writer.cs

5
Assets/Fungus/Scripts/Components/Writer.cs

@ -8,6 +8,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
using System.Globalization;
namespace Fungus namespace Fungus
{ {
@ -247,7 +248,7 @@ namespace Fungus
value = defaultValue; value = defaultValue;
if (paramList.Count > index) if (paramList.Count > index)
{ {
float.TryParse(paramList[index], out value); float.TryParse(paramList[index], NumberStyles.Any, CultureInfo.InvariantCulture, out value);
return true; return true;
} }
return false; return false;
@ -723,7 +724,7 @@ namespace Fungus
} }
float duration = 1f; float duration = 1f;
if (!float.TryParse(param, out duration)) if (!float.TryParse(param, NumberStyles.Any, CultureInfo.InvariantCulture, out duration))
{ {
duration = 1f; duration = 1f;
} }

Loading…
Cancel
Save