|
@@ -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;
|
|
|
}
|
|
|
|
|
|
//选中物体的位置
|