Browse Source

双指操作

zhaoyang 3 years ago
parent
commit
f8347805f6
1 changed files with 5 additions and 5 deletions
  1. 5 5
      GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographView.cs

+ 5 - 5
GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographView.cs

@@ -185,10 +185,10 @@ namespace GFGGame
 
         private void OnTouchUIBegin(EventContext context)
         {
+            context.CaptureTouch();
             if (_ui.m_ComSelectRes.target.visible == true) return;
-            if (Stage.inst.touchCount > 1) return;//只监听1根手指
+            if (Stage.inst.touchCount > 1 || context.inputEvent.touchId != 0) return;//只监听第一根1手指
             if (isTouchUI) return;
-            context.CaptureTouch();
 
             RaycastHit2D[] hit2Ds = Physics2D.RaycastAll(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);
             if (hit2Ds.Length > 0)
@@ -228,7 +228,7 @@ namespace GFGGame
         private void OnTouchUIMove(EventContext context)
         {
             if (hitParentGameObj == null) return;//未选中任何物体
-            if (Stage.inst.touchCount > 1) return;//只监听1根手指
+            if (Stage.inst.touchCount > 1 || context.inputEvent.touchId != 0) return; //只监听1根手指
             if (isTouchUI) return;
 
             Debug.Log("拖动");
@@ -238,8 +238,8 @@ namespace GFGGame
         }
         private void OnTouchUIEnd(EventContext context)
         {
-            if (Stage.inst.touchCount > 1) return;//只监听1根手指
-            if (context.inputEvent.touchId == 0) hitParentGameObj = null;
+            if (Stage.inst.touchCount > 1 || context.inputEvent.touchId != 0) return; //只监听1根手指
+            hitParentGameObj = null;
         }
 
         //选中物体的位置