Kaynağa Gözat

Merge remote-tracking branch 'remotes/origin/master' into insertcoin

# Conflicts:
#	Assets/BowArrow/Scripts/Standalone/GameTimeCounterSA.cs
调整测试投币,双击标点,homeview 内容
slambb 1 yıl önce
ebeveyn
işleme
32f0a8510b

+ 7 - 7
Assets/BowArrow/Resources/Textures/GameIcon/Prefabs/Views/Home/HomeView.prefab

@@ -352,7 +352,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 1, y: 1}
   m_AnchorMax: {x: 1, y: 1}
-  m_AnchoredPosition: {x: -128.25, y: -717}
+  m_AnchoredPosition: {x: -92.25, y: -964}
   m_SizeDelta: {x: 283.5083, y: 40}
   m_Pivot: {x: 1, y: 1}
 --- !u!222 &3622182153959318751
@@ -2262,7 +2262,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 0
+  m_IsActive: 1
 --- !u!224 &2222406711861982262
 RectTransform:
   m_ObjectHideFlags: 0
@@ -2281,7 +2281,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0.5, y: 0.5}
   m_AnchorMax: {x: 0.5, y: 0.5}
-  m_AnchoredPosition: {x: -34, y: 149}
+  m_AnchoredPosition: {x: -485, y: 149}
   m_SizeDelta: {x: 363, y: 410}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &1102167140889557110
@@ -8275,8 +8275,8 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 1, y: 1}
   m_AnchorMax: {x: 1, y: 1}
-  m_AnchoredPosition: {x: -120.00006, y: -392.5}
-  m_SizeDelta: {x: 300, y: 300}
+  m_AnchoredPosition: {x: -84, y: -392.5}
+  m_SizeDelta: {x: 520, y: 520}
   m_Pivot: {x: 1, y: 1}
 --- !u!222 &9067554990105667512
 CanvasRenderer:
@@ -8350,7 +8350,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0.5, y: 0.5}
   m_AnchorMax: {x: 0.5, y: 0.5}
-  m_AnchoredPosition: {x: -498, y: -291}
+  m_AnchoredPosition: {x: -484, y: -291}
   m_SizeDelta: {x: 363, y: 410}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &1755550183316214063
@@ -13077,7 +13077,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0.5, y: 0.5}
   m_AnchorMax: {x: 0.5, y: 0.5}
-  m_AnchoredPosition: {x: -499, y: 149}
+  m_AnchoredPosition: {x: -921, y: 149}
   m_SizeDelta: {x: 363, y: 410}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &3820897438241106996

+ 9 - 5
Assets/BowArrow/Scripts/Standalone/GameTimeCounterSA.cs

@@ -21,6 +21,13 @@ public class GameTimeCounterSA : MonoBehaviour
 
     void Update()
     {
+        //投币测试
+        if (Input.GetKeyDown(KeyCode.Alpha7) || Input.GetKeyDown(KeyCode.Alpha8))
+        {
+            //投币接口测试
+            StandaloneAPI.InsertCoinForAddTime();
+        }
+
         StandaloneAPI.DoGameTimeCountDown();
         playTimeText.text = string.Format("剩余时间{0}", GetTimeStr());
         if (StandaloneAPI.GetGameTimeCountDown() > 0)
@@ -46,12 +53,9 @@ public class GameTimeCounterSA : MonoBehaviour
             payTimeCountDownText.text = string.Format("投币继续游戏\n{0}S", t / 1000);
             if (t == 0) StandaloneAPI.ForceBackHome();
         }
+        //#if UNITY_EDITOR
 
-        if (Input.GetKeyDown(KeyCode.Z)) 
-        {
-            //投币接口测试
-            StandaloneAPI.InsertCoinForAddTime();
-        }
+        //#endif
     }
 
     string GetTimeStr()

+ 40 - 17
Assets/SmartBow/Scripts/Views/InfraredViewParts/PointMarker.cs

@@ -41,27 +41,50 @@ public class PointMarker : MonoBehaviour
     {
         if (AimHandler.ins) AimHandler.ins.OnCrossBtnEvent -= OnRecordInfrared;
     }
-
+    private float lastClickTime = 0f;
+    private float doubleClickThreshold = 0.3f; // 双击间隔时间,单位:秒
     void Update()
     {
-//#if UNITY_EDITOR
-        if (Input.GetKeyDown(KeyCode.Alpha6) || Input.GetMouseButtonDown(1))
+        if (Input.GetMouseButtonDown(0)) // 检测左键按下
         {
-            //Vector2 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
-            //MarkPoint(mousePosition);
-            // OnRecordInfrared();
-            if (currentPointIndex >= 4) return;
-            var mouse = Input.mousePosition;
-            var u = mouse.x / Screen.width;
-            var v = mouse.y / Screen.height;
-            u = Math.Clamp(u, 0, 1);
-            v = Math.Clamp(v, 0, 1);
-            Vector2 pos = new Vector2(u * ScreenLocate.Main.getUVCTexture.width, v * ScreenLocate.Main.getUVCTexture.height);
-            markedPoints.Add(pos);
-            // 设置标记的位置
-            MarkPoint(new Vector2(u, v).pixelToLocalPosition_AnchorCenter(new Vector2(1, 1), markerParent.GetComponent<RectTransform>().rect));
+            float currentTime = Time.time;
+            if (currentTime - lastClickTime <= doubleClickThreshold)
+            {
+                // 双击检测成功,执行触发逻辑
+                if (currentPointIndex >= 4) return;
+
+                var mouse = Input.mousePosition;
+                var u = mouse.x / Screen.width;
+                var v = mouse.y / Screen.height;
+                u = Math.Clamp(u, 0, 1);
+                v = Math.Clamp(v, 0, 1);
+
+                Vector2 pos = new Vector2(u * ScreenLocate.Main.getUVCTexture.width, v * ScreenLocate.Main.getUVCTexture.height);
+                markedPoints.Add(pos);
+
+                // 设置标记的位置
+                MarkPoint(new Vector2(u, v).pixelToLocalPosition_AnchorCenter(new Vector2(1, 1), markerParent.GetComponent<RectTransform>().rect));
+            }
+            lastClickTime = currentTime; // 更新上一次点击时间
         }
-//#endif
+        //#if UNITY_EDITOR
+        //if (Input.GetKeyDown(KeyCode.Alpha6) || Input.GetMouseButtonDown(1))
+        //{
+        //    //Vector2 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
+        //    //MarkPoint(mousePosition);
+        //    // OnRecordInfrared();
+        //    if (currentPointIndex >= 4) return;
+        //    var mouse = Input.mousePosition;
+        //    var u = mouse.x / Screen.width;
+        //    var v = mouse.y / Screen.height;
+        //    u = Math.Clamp(u, 0, 1);
+        //    v = Math.Clamp(v, 0, 1);
+        //    Vector2 pos = new Vector2(u * ScreenLocate.Main.getUVCTexture.width, v * ScreenLocate.Main.getUVCTexture.height);
+        //    markedPoints.Add(pos);
+        //    // 设置标记的位置
+        //    MarkPoint(new Vector2(u, v).pixelToLocalPosition_AnchorCenter(new Vector2(1, 1), markerParent.GetComponent<RectTransform>().rect));
+        //}
+        //#endif
     }
     /// <summary>
     /// 记录红外点