Browse Source

Merge branch 'master' of https://e.coding.net/shenyou-gfg/gfgclient/client

beiguoxia 3 years ago
parent
commit
672ad271ac
1 changed files with 11 additions and 13 deletions
  1. 11 13
      GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographView.cs

+ 11 - 13
GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographView.cs

@@ -55,6 +55,7 @@ namespace GFGGame
             _ui.m_btnBg.onClick.Add(OnClickBtnBg);
             _ui.m_btnBg.onClick.Add(OnClickBtnBg);
             _ui.m_btnChoose.onClick.Add(OnClickBtnChoose);
             _ui.m_btnChoose.onClick.Add(OnClickBtnChoose);
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
+            _ui.m_comSelectBox.m_btnDelete.onClick.Add(OnClickBtnDelete);
             _ui.m_btnPhotograph.onClick.Add(OnClickBtnPhotograph);
             _ui.m_btnPhotograph.onClick.Add(OnClickBtnPhotograph);
 
 
             _ui.m_ComSelectRes.m_list.itemRenderer = RenderListItem;
             _ui.m_ComSelectRes.m_list.itemRenderer = RenderListItem;
@@ -267,16 +268,10 @@ namespace GFGGame
             GameObject gameObject = _ui.m_comSelectBox.target.data as GameObject;
             GameObject gameObject = _ui.m_comSelectBox.target.data as GameObject;
             InputEvent inputEvent = (InputEvent)context.data;
             InputEvent inputEvent = (InputEvent)context.data;
 
 
-            Vector2 pt1 = this.viewCom.GlobalToLocal(new Vector2(inputEvent.x, inputEvent.y));
-            Vector2 screenPos = _ui.m_comSelectBox.target.LocalToGlobal(Vector2.zero);
-            Vector2 pt2 = screenPos;// this.viewCom.GlobalToLocal(new Vector2(_ui.m_comSelectBox.target.x, _ui.m_comSelectBox.target.y));
-            float dist = Vector2.Distance(pt1, pt2);
-            _startDistance = dist;/// gameObject.transform.localScale.x;
-            // Vector2 screenPos = _ui.m_comSelectBox.target.LocalToGlobal(Vector2.zero);
-            // Vector2 posInB = new Vector2(_ui.m_comSelectBox.m_btnSize.x, _ui.m_comSelectBox.m_btnSize.y);
-            // Vector2 pt1 = screenPos;// this.viewCom.GlobalToLocal(screenPos); ;
-            // _startDistance = Mathf.Sqrt(pt1.x * pt1.x + pt1.y * pt1.y) / 2;// Vector2.Distance(pt1, pt2);
-            Debug.Log("     _startDistance:" + _startDistance + "   pt1:" + pt1 + "    screenPos:" + screenPos);
+            Vector2 pt1 = _ui.m_comSelectBox.target.size;// this.viewCom.GlobalToLocal(screenPos); ;
+            _startDistance = Mathf.Sqrt(pt1.x * pt1.x + pt1.y * pt1.y) / 2;// Vector2.Distance(pt1, pt2);
+            Debug.Log("_startDistance:" + _startDistance);
+
         }
         }
         private void OnClickBtnSizeMove(EventContext context)
         private void OnClickBtnSizeMove(EventContext context)
         {
         {
@@ -294,8 +289,6 @@ namespace GFGGame
             ControllerRotate(angle, gameObject);
             ControllerRotate(angle, gameObject);
             Debug.Log("angle:" + angle);
             Debug.Log("angle:" + angle);
 
 
-            // Vector2 pt1 = this.viewCom.GlobalToLocal(new Vector2(inputEvent.x, inputEvent.y));
-            // Vector2 pt2 = this.viewCom.GlobalToLocal(_ui.m_comSelectBox.target.position);
             float dist = Vector2.Distance(pt1, pt2);
             float dist = Vector2.Distance(pt1, pt2);
             Debug.Log("dist:" + dist);
             Debug.Log("dist:" + dist);
 
 
@@ -421,6 +414,11 @@ namespace GFGGame
             _ui.m_comSelectBox.target.visible = false;
             _ui.m_comSelectBox.target.visible = false;
             hitParentGameObj = null;
             hitParentGameObj = null;
         }
         }
+        private void OnClickBtnDelete()
+        {
+            GameObject gameObject = _ui.m_comSelectBox.target.data as GameObject;
+
+        }
         private void OnClickBtnPhotograph()
         private void OnClickBtnPhotograph()
         {
         {
             _ui.target.visible = false;
             _ui.target.visible = false;
@@ -430,7 +428,7 @@ namespace GFGGame
         {
         {
             _ui.target.visible = false;
             _ui.target.visible = false;
             yield return new WaitForEndOfFrame();
             yield return new WaitForEndOfFrame();
-            // Texture2D tex = UnityEngine.ScreenCapture.CaptureScreenshotAsTexture();
+
             Rect rect = new Rect(0, 0, UnityEngine.Screen.width, UnityEngine.Screen.height);
             Rect rect = new Rect(0, 0, UnityEngine.Screen.width, UnityEngine.Screen.height);
             Texture2D tex = new Texture2D((int)rect.width, (int)rect.height, TextureFormat.ARGB32, false);//新建一个Texture2D对象
             Texture2D tex = new Texture2D((int)rect.width, (int)rect.height, TextureFormat.ARGB32, false);//新建一个Texture2D对象
             tex.ReadPixels(rect, 0, 0);//读取像素,屏幕左下角为0点
             tex.ReadPixels(rect, 0, 0);//读取像素,屏幕左下角为0点