|
@@ -231,13 +231,10 @@ namespace GFGGame
|
|
|
|
|
|
distance = Input.mousePosition - Camera.main.WorldToScreenPoint(hitGameObj.transform.position);
|
|
|
|
|
|
-
|
|
|
- // if (memoryHitParentGameObj == null || memoryHitParentGameObj as GameObject != hitParentGameObj)
|
|
|
- // {
|
|
|
lastPos = Vector2.zero;
|
|
|
_ui.m_comSelectBox.target.rotation = -hitGameObj.transform.eulerAngles.z;
|
|
|
_ui.m_comSelectBox.target.size = SceneController.GetGameObjectSize(hitGameObj);
|
|
|
- // }
|
|
|
+
|
|
|
memoryHitGameObj = hitGameObj;
|
|
|
|
|
|
ControllerSelectBoxPos();
|
|
@@ -258,10 +255,6 @@ namespace GFGGame
|
|
|
{
|
|
|
if (Stage.inst.touchCount > 1 || context.inputEvent.touchId != 0) return; //只监听1根手指
|
|
|
hitGameObj = null;
|
|
|
- // if (Stage.inst.touchCount == 0)
|
|
|
- // {
|
|
|
- // isTwoTouchPoint = false;
|
|
|
- // }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -298,7 +291,7 @@ namespace GFGGame
|
|
|
//选中框的位置
|
|
|
private void ControllerSelectBoxPos()
|
|
|
{
|
|
|
- // SceneController.SetGameObjectCenter(hitGameObj);
|
|
|
+
|
|
|
Vector2 objScreenPos = Camera.main.WorldToScreenPoint(hitGameObj.transform.position);
|
|
|
Vector2 localPos = this.viewCom.GlobalToLocal(new Vector2(objScreenPos.x, (Screen.height - objScreenPos.y)));
|
|
|
_ui.m_comSelectBox.target.position = localPos;
|
|
@@ -309,7 +302,6 @@ namespace GFGGame
|
|
|
private void OnTouchBtnSizeBegin(EventContext context)
|
|
|
{
|
|
|
|
|
|
- // GameObject memoryHitParentGameObj = this.memoryHitParentGameObj as GameObject;
|
|
|
InputEvent inputEvent = (InputEvent)context.data;
|
|
|
Vector2 screenPos = this.viewCom.GlobalToLocal(_ui.m_comSelectBox.m_btnSize.LocalToGlobal(Vector2.zero));
|
|
|
Vector2 pt = new Vector2(screenPos.x, screenPos.y);
|
|
@@ -320,13 +312,10 @@ namespace GFGGame
|
|
|
float distance = Vector2.Distance(pt, pt2) / memoryHitGameObj.transform.localScale.x;
|
|
|
_equipDistance.Add(memoryHitGameObj, distance);
|
|
|
}
|
|
|
- // _startDistance = _equipDistance[memoryHitGameObj];
|
|
|
- // Debug.Log("_startDistance:" + _startDistance);
|
|
|
|
|
|
}
|
|
|
private void OnTouchBtnSizeMove(EventContext context)
|
|
|
{
|
|
|
- // GameObject memoryHitParentGameObj = this.memoryHitParentGameObj as GameObject;
|
|
|
if (memoryHitGameObj == null) return;
|
|
|
InputEvent inputEvent = (InputEvent)context.data;
|
|
|
Vector2 pt1 = this.viewCom.GlobalToLocal(new Vector2(inputEvent.x, inputEvent.y));
|
|
@@ -359,7 +348,6 @@ namespace GFGGame
|
|
|
|
|
|
if (hitGameObj == null) return;
|
|
|
if (hitGameObj.name == "BgRes") return;//背景不可以缩放、旋转
|
|
|
- // isTwoTouchPoint = true;
|
|
|
|
|
|
GTween.Kill(hitGameObj);
|
|
|
PinchGesture gesture = (PinchGesture)context.sender;
|
|
@@ -435,6 +423,7 @@ namespace GFGGame
|
|
|
SceneController.UpdatePhotographBgOrNpcOrBorder(_sceneObject, itemCfg.id, tf, resPath);
|
|
|
SpriteRenderer spr = tf.GetComponent<SpriteRenderer>();
|
|
|
spr.sortingOrder = maxLayer;
|
|
|
+ tf.localPosition = new Vector2(-spr.bounds.center.x, -spr.bounds.center.y);
|
|
|
SceneController.PhotographAddCollider(tf.gameObject);
|
|
|
}
|
|
|
private void UpdateBorder(ItemCfg itemCfg)
|