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

+ 6 - 1
GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographView.cs

@@ -236,9 +236,14 @@ namespace GFGGame
             Debug.Log("物体世界坐标:" + hitParentGameObj.transform.position);
             //位置:角色、道具、npc全用对应父物体的位置
             Vector2 objScreenPos = Camera.main.WorldToScreenPoint(hitParentGameObj.transform.position);
+            this.viewCom.GlobalToLocal(objScreenPos);
+
             Debug.Log("物体屏幕坐标:" + hitParentGameObj.transform.position);
             Debug.Log("屏幕高:" + Screen.height);
-            Vector2 localPos = new Vector2(objScreenPos.x, (Screen.height - objScreenPos.y));
+            // Vector2 localPos = new Vector2(objScreenPos.x, (Screen.height - objScreenPos.y));
+            Vector2 localPos = this.viewCom.GlobalToLocal(new Vector2(objScreenPos.x, (Screen.height - objScreenPos.y)));
+
+            Debug.Log("localPos:" + localPos);
             Debug.Log("选框坐标:" + _ui.m_comSelectBox.target.position);
 
             _ui.m_comSelectBox.target.position = localPos;//(localPos.x, localPos.y);