|
@@ -207,7 +207,7 @@ namespace GFGGame
|
|
|
context.CaptureTouch();
|
|
|
if (_ui.m_ComSelectRes.target.visible == true) return;
|
|
|
//两根手指点击屏幕||两根手指点过屏幕
|
|
|
- if (Stage.inst.touchCount > 1 || isTwoTouchPoint) return;//只监听一根手指
|
|
|
+ if (Stage.inst.touchCount > 1 && hitParentGameObj != null) return;//只监听一根手指
|
|
|
|
|
|
if (IsTouchUI) return;
|
|
|
|
|
@@ -249,7 +249,7 @@ namespace GFGGame
|
|
|
private void OnTouchUIMove(EventContext context)
|
|
|
{
|
|
|
if (hitParentGameObj == null) return;//未选中任何物体
|
|
|
- if (Stage.inst.touchCount > 1 || context.inputEvent.touchId != 0 || isTwoTouchPoint) return; //只监听1根手指
|
|
|
+ if (Stage.inst.touchCount > 1 || isTwoTouchPoint) return; //只监听1根手指
|
|
|
if (IsTouchUI) return;
|
|
|
|
|
|
Debug.Log("拖动");
|
|
@@ -368,18 +368,18 @@ namespace GFGGame
|
|
|
//双指缩放
|
|
|
private void OnPinch(EventContext context)
|
|
|
{
|
|
|
- GameObject gameObject = _ui.m_comSelectBox.target.data as GameObject;
|
|
|
- // if (hitParentGameObj == null) return;
|
|
|
- if (gameObject.name == "BgRes") return;//背景不可以缩放、旋转
|
|
|
+ // GameObject gameObject = _ui.m_comSelectBox.target.data as GameObject;
|
|
|
+ if (hitParentGameObj == null) return;
|
|
|
+ if (hitParentGameObj.name == "BgRes") return;//背景不可以缩放、旋转
|
|
|
isTwoTouchPoint = true;
|
|
|
|
|
|
- GTween.Kill(gameObject);
|
|
|
+ GTween.Kill(hitParentGameObj);
|
|
|
|
|
|
PinchGesture gesture = (PinchGesture)context.sender;
|
|
|
- float newValue = Mathf.Clamp(gameObject.transform.localScale.x + gesture.delta, 0.3f, 2);
|
|
|
+ float newValue = Mathf.Clamp(hitParentGameObj.transform.localScale.x + gesture.delta, 0.3f, 2);
|
|
|
Debug.Log("双指缩放:" + newValue);
|
|
|
|
|
|
- ControllerScale(newValue, gameObject);
|
|
|
+ ControllerScale(newValue, hitParentGameObj);
|
|
|
}
|
|
|
|
|
|
private void ControllerScale(float value, GameObject gameObject)
|
|
@@ -393,18 +393,18 @@ namespace GFGGame
|
|
|
|
|
|
private void OnRotate(EventContext context)
|
|
|
{
|
|
|
- GameObject gameObject = _ui.m_comSelectBox.target.data as GameObject;
|
|
|
- // if (hitParentGameObj == null) return;
|
|
|
- if (gameObject.name == "BgRes") return;//背景不可以缩放、旋转
|
|
|
+ // GameObject gameObject = _ui.m_comSelectBox.target.data as GameObject;
|
|
|
+ if (hitParentGameObj == null) return;
|
|
|
+ if (hitParentGameObj.name == "BgRes") return;//背景不可以缩放、旋转
|
|
|
isTwoTouchPoint = true;
|
|
|
|
|
|
|
|
|
- GTween.Kill(gameObject.transform);
|
|
|
+ GTween.Kill(hitParentGameObj.transform);
|
|
|
|
|
|
RotationGesture gesture = (RotationGesture)context.sender;
|
|
|
Debug.Log("双指旋转:" + gesture.delta);
|
|
|
|
|
|
- ControllerRotate(gesture.delta, gameObject);
|
|
|
+ ControllerRotate(gesture.delta, hitParentGameObj);
|
|
|
}
|
|
|
private void ControllerRotate(float value, GameObject gameObject)
|
|
|
{
|