diff --git a/Assets/Scripts/Scenes/Ride/Scripts/CyclingController.cs b/Assets/Scripts/Scenes/Ride/Scripts/CyclingController.cs index 762d7d7b..968e147e 100644 --- a/Assets/Scripts/Scenes/Ride/Scripts/CyclingController.cs +++ b/Assets/Scripts/Scenes/Ride/Scripts/CyclingController.cs @@ -297,13 +297,15 @@ public class CyclingController : DeviceServiceMonoBase //单指 var touchRecognizer = new TKAnyTouchRecognizer(new TKRect(0, 0, Screen.width, Screen.height)); DateTime startTimpStamp = DateTime.Now; + Vector2 touchLocation = Vector2.down; touchRecognizer.onEnteredEvent += (r) => { + touchLocation = r.startTouchLocation(); startTimpStamp = DateTime.Now; }; touchRecognizer.onExitedEvent += (r) => { - if (competitionId == 0 && isStart && IsPointerOverGameObject(r.startTouchLocation())) + if (competitionId == 0 && isStart && IsPointerOverGameObject(touchLocation)) { var timespan = DateTime.Now - startTimpStamp; UnityEngine.Debug.Log($"{timespan.TotalMilliseconds}");