Browse Source

Fix #822 - Parse with CultureInvariant

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

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

@ -8,6 +8,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Globalization;
namespace Fungus
{
@ -245,9 +246,9 @@ namespace Fungus
protected virtual bool TryGetSingleParam(List<string> paramList, int index, float defaultValue, out float value)
{
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 false;
@ -723,7 +724,7 @@ namespace Fungus
}
float duration = 1f;
if (!float.TryParse(param, out duration))
if (!float.TryParse(param, NumberStyles.Any, CultureInfo.InvariantCulture, out duration))
{
duration = 1f;
}

Loading…
Cancel
Save