单击手势进入极简模式

This commit is contained in:
lishuo 2021-12-22 16:20:27 +08:00
parent 67abc1ef63
commit d91dc17ea7

View File

@ -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}");