|
@@ -48,6 +48,7 @@ namespace GFGGame
|
|
|
private RotationGesture rotationGesture;
|
|
|
|
|
|
private bool isTouchUI = false;//点击在m_comSelectBox按钮上
|
|
|
+ private bool isTwoTouchPoint = false;
|
|
|
private int maxLayer = int.MinValue;//最上层的层级数
|
|
|
protected override void OnInit()
|
|
|
{
|
|
@@ -186,7 +187,7 @@ namespace GFGGame
|
|
|
{
|
|
|
context.CaptureTouch();
|
|
|
if (_ui.m_ComSelectRes.target.visible == true) return;
|
|
|
- if (Stage.inst.touchCount > 1 || context.inputEvent.touchId != 0) return;//只监听第一根1手指
|
|
|
+ if (Stage.inst.touchCount > 1 || context.inputEvent.touchId != 0 || isTwoTouchPoint) return;//只监听一根手指
|
|
|
if (isTouchUI) return;
|
|
|
|
|
|
RaycastHit2D[] hit2Ds = Physics2D.RaycastAll(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);
|
|
@@ -227,7 +228,7 @@ namespace GFGGame
|
|
|
private void OnTouchUIMove(EventContext context)
|
|
|
{
|
|
|
if (hitParentGameObj == null) return;//未选中任何物体
|
|
|
- if (Stage.inst.touchCount > 1 || context.inputEvent.touchId != 0) return; //只监听1根手指
|
|
|
+ if (Stage.inst.touchCount > 1 || context.inputEvent.touchId != 0 || isTwoTouchPoint) return; //只监听1根手指
|
|
|
if (isTouchUI) return;
|
|
|
|
|
|
Debug.Log("拖动");
|
|
@@ -239,6 +240,10 @@ namespace GFGGame
|
|
|
{
|
|
|
if (Stage.inst.touchCount > 1 || context.inputEvent.touchId != 0) return; //只监听1根手指
|
|
|
hitParentGameObj = null;
|
|
|
+ if (Stage.inst.touchCount == 0)
|
|
|
+ {
|
|
|
+ isTwoTouchPoint = false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//选中物体的位置
|
|
@@ -342,7 +347,8 @@ namespace GFGGame
|
|
|
private void OnPinch(EventContext context)
|
|
|
{
|
|
|
if (hitParentGameObj == null) return;
|
|
|
- if (hitParentGameObj == bgParent) return;//背景不可以缩放、旋转
|
|
|
+ if (hitParentGameObj.name == "BgRes") return;//背景不可以缩放、旋转
|
|
|
+ isTwoTouchPoint = true;
|
|
|
|
|
|
GTween.Kill(hitParentGameObj);
|
|
|
|
|
@@ -357,7 +363,6 @@ namespace GFGGame
|
|
|
if (value > MaxScale || value < MinScale) return;
|
|
|
gameObject.transform.localScale = new Vector3(value, value, value);
|
|
|
Debug.Log("双指缩放:" + value);
|
|
|
- distance = distance * value;
|
|
|
Vector2 size = SceneController.GetGameObjectSize(gameObject);
|
|
|
_ui.m_comSelectBox.target.SetSize(size.x, size.y);
|
|
|
}
|
|
@@ -366,7 +371,8 @@ namespace GFGGame
|
|
|
private void OnRotate(EventContext context)
|
|
|
{
|
|
|
if (hitParentGameObj == null) return;
|
|
|
- if (hitParentGameObj == bgParent) return;//背景不可以缩放、旋转
|
|
|
+ if (hitParentGameObj.name == "BgRes") return;//背景不可以缩放、旋转
|
|
|
+ isTwoTouchPoint = true;
|
|
|
|
|
|
|
|
|
GTween.Kill(hitParentGameObj.transform);
|
|
@@ -385,16 +391,6 @@ namespace GFGGame
|
|
|
private void UpdateBody()
|
|
|
{
|
|
|
|
|
|
- // SceneController.UpdateRole(_equipRoleData.ToArray(), _sceneObject, false, null, false, bodyParent);
|
|
|
- // if (equipDataCache.IsSuitPic && equipDataCache.suitId > 0)
|
|
|
- // {
|
|
|
- // SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(equipDataCache.suitId);
|
|
|
- // DressUpUtil.UpdateBody(suitCfg.picRes, _sceneObject, false, null, false, bodyParent);
|
|
|
- // }
|
|
|
- // GameObject gameObject = _sceneObject.transform.Find("Scene/Role/Body").gameObject;
|
|
|
-
|
|
|
- // SceneController.PhotographAddCollider(gameObject);
|
|
|
-
|
|
|
SceneController.UpdatePhotographBody(_equipRoleData.ToArray(), _sceneObject, false, null, false, bodyParent);
|
|
|
}
|
|
|
//场景道具
|