zhaoyang 3 سال پیش
والد
کامیت
aba5ccad79

+ 0 - 1
GameClient/Assets/Game/HotUpdate/DressUp/SceneController.cs

@@ -171,7 +171,6 @@ namespace GFGGame
 
         public static void UpdatePhotographBgOrNpcOrBorder(GameObject sceneObj, int itemId, Transform tf, string resPath)
         {
-            // Transform tf = sceneObj.transform.Find(objName);
             tf.position = Vector3.zero;
             SpriteRenderer spr = tf.GetComponent<SpriteRenderer>();
             if (spr == null)

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

@@ -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)

+ 4 - 0
GameClient/Assets/ThirdParty/FairyGUI/Scripts/Gesture/RotationGesture.cs

@@ -122,6 +122,7 @@ namespace FairyGUI
 
         void __touchMove(EventContext context)
         {
+            Debug.Log("zoya_000:" + _touchBegan + "    " + Stage.inst.touchCount);
             if (!_touchBegan || Stage.inst.touchCount != 2)
                 return;
 
@@ -131,12 +132,15 @@ namespace FairyGUI
             Vector2 vec = pt1 - pt2;
 
             float rot = Mathf.Rad2Deg * ((Mathf.Atan2(vec.y, vec.x) - Mathf.Atan2(_startVector.y, _startVector.x)));
+            Debug.Log("zoya_111:" + rot + "    " + vec + "     " + _startVector);
+
             if (snapping)
             {
                 rot = Mathf.Round(rot);
                 if (rot == 0)
                     return;
             }
+            Debug.Log("zoya_222:" + _started + "     " + rot);
 
             if (!_started && rot > 5)
             {