Browse Source

小游戏修改

zhangyuqian 1 year ago
parent
commit
c7ff7712a9
1 changed files with 22 additions and 22 deletions
  1. 22 22
      GameClient/Assets/Game/HotUpdate/Views/MiniGame/TZFEGameVIew.cs

+ 22 - 22
GameClient/Assets/Game/HotUpdate/Views/MiniGame/TZFEGameVIew.cs

@@ -492,28 +492,28 @@ namespace GFGGame
         }
         private void OnClickEnd()
         {
-                touchSecond = Input.mousePosition;//记录拖动的位置
-                if ((touchSecond.x - touchFirst.x) < -80 && Math.Abs(touchSecond.x - touchFirst.x) > Math.Abs(touchSecond.y - touchFirst.y))
-                {
-                    //向左滑动
-                    Move(Map, Direction.left);
-                }
-                if ( (touchSecond.x - touchFirst.x) > 80 && Math.Abs(touchSecond.x - touchFirst.x) > Math.Abs(touchSecond.y - touchFirst.y))
-                {
-                    //向右滑动
-                    Move(Map, Direction.right);
-                }
-                if ((touchSecond.y - touchFirst.y) < -80 && Math.Abs(touchSecond.y - touchFirst.y) > Math.Abs(touchSecond.x - touchFirst.x))
-                {
-                    //向下滑动
-                    Move(Map, Direction.down);
-                }
-                if ((touchSecond.y - touchFirst.y) > 80 && Math.Abs(touchSecond.y - touchFirst.y) > Math.Abs(touchSecond.x - touchFirst.x))
-                {
-                    //向上滑动
-                    Move(Map, Direction.up);
-                }
-                touchFirst = touchSecond;
+            touchSecond = Input.mousePosition;//记录拖动的位置
+            if (touchSecond.x < touchFirst.x && Math.Abs(touchSecond.x - touchFirst.x) > Math.Abs(touchSecond.y - touchFirst.y))
+            {
+                //向左滑动
+                Move(Map, Direction.left);
+            }
+            if (touchSecond.x > touchFirst.x && Math.Abs(touchSecond.x - touchFirst.x) > Math.Abs(touchSecond.y - touchFirst.y))
+            {
+                //向右滑动
+                Move(Map, Direction.right);
+            }
+            if (touchSecond.y < touchFirst.y && Math.Abs(touchSecond.y - touchFirst.y) > Math.Abs(touchSecond.x - touchFirst.x))
+            {
+                //向下滑动
+                Move(Map, Direction.down);
+            }
+            if (touchSecond.y > touchFirst.y && Math.Abs(touchSecond.y - touchFirst.y) > Math.Abs(touchSecond.x - touchFirst.x))
+            {
+                //向上滑动
+                Move(Map, Direction.up);
+            }
+            touchFirst = touchSecond;
         }
 
         private void OnClickMergeTips()