浏览代码

双指操作

zhaoyang 3 年之前
父节点
当前提交
f8347805f6
共有 1 个文件被更改,包括 5 次插入5 次删除
  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)
         private void OnTouchUIBegin(EventContext context)
         {
         {
+            context.CaptureTouch();
             if (_ui.m_ComSelectRes.target.visible == true) return;
             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;
             if (isTouchUI) return;
-            context.CaptureTouch();
 
 
             RaycastHit2D[] hit2Ds = Physics2D.RaycastAll(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);
             RaycastHit2D[] hit2Ds = Physics2D.RaycastAll(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);
             if (hit2Ds.Length > 0)
             if (hit2Ds.Length > 0)
@@ -228,7 +228,7 @@ namespace GFGGame
         private void OnTouchUIMove(EventContext context)
         private void OnTouchUIMove(EventContext context)
         {
         {
             if (hitParentGameObj == null) return;//未选中任何物体
             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;
             if (isTouchUI) return;
 
 
             Debug.Log("拖动");
             Debug.Log("拖动");
@@ -238,8 +238,8 @@ namespace GFGGame
         }
         }
         private void OnTouchUIEnd(EventContext context)
         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;
         }
         }
 
 
         //选中物体的位置
         //选中物体的位置