Skip to content

Commit d3a1946

Browse files
author
Daumas Hugo
committed
fix(Unity Demo): fix setRotatioSpeed float Parsing
When launching the demo on flutter Android you couldn't change the rotation speed because it was Parsed in such a way that the "0.0" format throwed a Parsing Error
1 parent 7f55bc2 commit d3a1946

File tree

1 file changed

+2
-1
lines changed
  • example/unity/DemoApp/Assets/FlutterUnityIntegration/Demo

1 file changed

+2
-1
lines changed

example/unity/DemoApp/Assets/FlutterUnityIntegration/Demo/Rotate.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using FlutterUnityIntegration;
33
using UnityEngine;
44
using UnityEngine.EventSystems;
5+
using System.Globalization;
56

67
public class Rotate : MonoBehaviour, IEventSystemHandler
78
{
@@ -39,7 +40,7 @@ void Update()
3940
// This method is called from Flutter
4041
public void SetRotationSpeed(String message)
4142
{
42-
float value = float.Parse(message);
43+
float value = float.Parse(message , CultureInfo.InvariantCulture.NumberFormat);
4344
RotateAmount = new Vector3(value, value, value);
4445
}
4546
}

0 commit comments

Comments
 (0)