zhaoyang 3 年之前
父节点
当前提交
6d630e14fb
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographView.cs

+ 4 - 3
GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographView.cs

@@ -297,14 +297,15 @@ namespace GFGGame
 
             GameObject gameObject = _ui.m_comSelectBox.target.data as GameObject;
             InputEvent inputEvent = (InputEvent)context.data;
-
-            Vector2 pt1 = this.viewCom.GlobalToLocal(new Vector2(inputEvent.x, inputEvent.y) / gameObject.transform.localScale);
+            Vector2 screenPos = this.viewCom.GlobalToLocal(_ui.m_comSelectBox.m_btnSize.LocalToGlobal(Vector2.zero));
+            Vector2 pt = new Vector2(screenPos.x, screenPos.y);
+            Vector2 pt1 = this.viewCom.GlobalToLocal(new Vector2(inputEvent.x, inputEvent.y));
             Vector2 pt2 = new Vector2(_ui.m_comSelectBox.target.x, _ui.m_comSelectBox.target.y);
             Debug.Log("pt1" + pt1 + "   pt2:" + pt2);
 
             if (!_equipDistance.ContainsKey(gameObject))
             {
-                float distance = Vector2.Distance(pt1, pt2);
+                float distance = Vector2.Distance(pt, pt2);/// gameObject.transform.localScale.x;
                 _equipDistance.Add(gameObject, distance);
             }
             _startDistance = _equipDistance[gameObject];