From d91dc17ea7763912034315f9f4a168f7acf29b86 Mon Sep 17 00:00:00 2001 From: lishuo Date: Wed, 22 Dec 2021 16:20:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E5=87=BB=E6=89=8B=E5=8A=BF=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E6=9E=81=E7=AE=80=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Scenes/Ride/Scripts/CyclingController.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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}");