Эх сурвалжийг харах

调整射箭和枪的时间区别。准心的颜色。部分测试按钮处理

slambb 1 жил өмнө
parent
commit
a060df1810

+ 30 - 9
Assets/BowArrow/Modules/InfraredGuider/InfraredGuider.cs

@@ -173,13 +173,17 @@ public class InfraredGuider : MonoBehaviour
                 if (BluetoothAim.ins.isMainConnectToHOUYIPRO())
                 {
                     Title1.SetActive(true);
+                    setShowTime(Title1);
                 }
                 else if (BluetoothAim.ins.isMainConnectToARTEMISPRO())
                 {
                     Title1ARTEMISPro.SetActive(true);
-                }else if (BluetoothAim.ins.isMainConnectToGun())
+                    setShowTime(Title1ARTEMISPro);
+                }
+                else if (BluetoothAim.ins.isMainConnectToGun())
                 {
                     Title1GunPro.SetActive(true);
+                    setShowTime(Title1GunPro);
                 }
                 break;
             case TipStep.Finish:
@@ -188,6 +192,16 @@ public class InfraredGuider : MonoBehaviour
                 break;
         }
     }
+    /**
+     * 根据不同的设备设置时间
+     */
+    void setShowTime(GameObject obj) {
+        float time = GlobalData.MyDeviceMode == DeviceMode.Gun ? CommonConfig.calibrationTimeGun : CommonConfig.calibrationTimeArchery;
+        TextAutoLanguage2 language2 = obj.GetComponent<TextAutoLanguage2>();
+        language2.textFormatArgs = new object[] { Mathf.CeilToInt(time) };
+        language2.ApplyToText();
+    }
+
     void AllTipFalse() {
         TitleCrossHair.SetActive(false);
         TitleCrossHair2.SetActive(false);
@@ -261,15 +275,22 @@ public class InfraredGuider : MonoBehaviour
 
     //void OnDisable()
     //{
-       
+
     //}
 
-    //private void Update()
-    //{
-    //    if (Input.GetKeyDown(KeyCode.Alpha5))
-    //    {
+#if UNITY_EDITOR
+    private void Update()
+    {
+        //跳过引导
+        if (Input.GetKeyDown(KeyCode.Alpha5))
+        {
+            onClickDevice();
+        }
+        if (Input.GetKeyDown(KeyCode.Alpha6))
+        {
+            onLongClickDevice();
+        }
+    }
+#endif
 
-    //        onLongClickDevice();
-    //    }
-    //}
 }

+ 8 - 0
Assets/BowArrow/Scripts/CommonConfig.cs

@@ -62,6 +62,14 @@ public class CommonConfig
     //实体模具箭重,单位克
     public static float arrowWeight = 75;
 
+    #region 校准引导时候。校准的时间
+    /**弓箭方案时间 */
+    public static float calibrationTimeArchery { get; } = 10;
+    /**枪时间*/
+    public static float calibrationTimeGun { get; } = 10;
+    #endregion
+
+
     public enum ServerType { LocalTest, Produce, Test };
     private static ServerType serverType = ServerType.Produce;
     //网关服务器访问地址

+ 3 - 3
Assets/BowArrow/Scripts/Components/TextAutoLanguage2/Resources/TextAutoLanguage2/cn.json

@@ -563,9 +563,9 @@
   "TopTip_CrossHair": "单击模块上的 <sprite=0> 按键,这是进入准心调整界面的开/关,\n请连续操作两次。",
   "TopTip_CrossHairPro": "单击设备上的按键,这是进入准心调整界面的开/关,\n请连续操作两次。",
   "TopTip_CrossHairGunPro": "取出弹夹模块,单击其上的按键,这是进入准心\n调整界面的开/关,请连接操作两次。",
-  "TopTip_ARTEMISPro": " 双击设备上的按键进行准心校准,之后请用正常的拉弓姿势,\n以箭筒头部为参考点瞄准靶心,10秒后完成准心校准。",
-  "TopTip_GunPro": "取出弹夹模块,双击其上的按键进行准心校准,快速装回弹夹后,\n用三点一线的射击姿势瞄准靶心,10秒后完成准心校准。",
-  "TopTip": " 长按模块上的按键 <sprite=0> 3秒进行准心校准,之后请用正常的拉弓姿势,以箭筒头部为参考点瞄准靶心,10秒后完成准心校准",
+  "TopTip_ARTEMISPro": " 双击设备上的按键进行准心校准,之后请用正常的拉弓姿势,\n以箭筒头部为参考点瞄准靶心,{0}秒后完成准心校准。",
+  "TopTip_GunPro": "取出弹夹模块,双击其上的按键进行准心校准,快速装回弹夹后,\n用三点一线的射击姿势瞄准靶心,{0}秒后完成准心校准。",
+  "TopTip": " 长按模块上的按键 <sprite=0> 3秒进行准心校准,之后请用正常的拉弓姿势,以箭筒头部为参考点瞄准靶心,{0}秒后完成准心校准",
   "TopTip2": "准心已校准,请射中靶子后,自动退出界面。",
   "LeftTitle": "异常问题检测",
   "LeftTip": "1、如发现光标不顺滑,或光标的移动范围不够大,请调整图像亮度或重新进行屏幕定位。\n\n2、如发现光标移动时有延时的现象,请调整分辨率或更换性能更好的手机后,再重新进行测试。\n\n3、如发现光标会随机闪烁不同的位置,或无法移动时,请点击环境测光寻找干扰源,并屏蔽干扰源。",

+ 3 - 3
Assets/BowArrow/Scripts/Components/TextAutoLanguage2/Resources/TextAutoLanguage2/en.json

@@ -613,9 +613,9 @@
   "TopTip_CrossHair": "Click the <sprite=0> button on the module to enter the center adjustment \n interface. Please operate it twice in a row.",
   "TopTip_CrossHairPro": "Click the button on the device. This toggles the crosshair adjustment interface on/off.\nPlease perform this action twice in a row.",
   "TopTip_CrossHairGunPro": "Remove the magazine module and click the button on it. This is the on/off button to enter the alignment adjustment interface. Please connect the operation twice",
-  "TopTip_ARTEMISPro": "Double click the button on the device to calibrate the center of gravity.\nThen, use the normal bow position and aim at the target with the arrow head \nas the reference point. After 10 seconds, complete the center of gravity calibration.",
-  "TopTip_GunPro": "Remove the magazine module, double-click the button on it to calibrate the center\n of sight, quickly reinstall the magazine, aim at the target with a three-point line\n shooting posture, and complete the center of sight calibration after 10 seconds.",
-  "TopTip": "Press and hold the button<sprite=0>on the module for 3 seconds to calibrate the center of sight. Then, use the normal bow position and aim at the target with the head of the arrow tube as the reference point. After 10 seconds, complete the center of sight calibration",
+  "TopTip_ARTEMISPro": "Double click the button on the device to calibrate the center of gravity.\nThen, use the normal bow position and aim at the target with the arrow head \nas the reference point. After {0} seconds, complete the center of gravity calibration.",
+  "TopTip_GunPro": "Remove the magazine module, double-click the button on it to calibrate the center\n of sight, quickly reinstall the magazine, aim at the target with a three-point line\n shooting posture, and complete the center of sight calibration after {0} seconds.",
+  "TopTip": "Press and hold the button<sprite=0>on the module for 3 seconds to calibrate the center of sight. Then, use the normal bow position and aim at the target with the head of the arrow tube as the reference point. After {0} seconds, complete the center of sight calibration",
   "TopTip2": "Accurate heart calibration, please hit the target and automatically exit the interface.",
   "LeftTitle": "Abnormal Problem Detection",
   "LeftTip": "1、If the cursor is not smooth or its movement range is insufficient, please adjust the image brightness or reposition the screen.\n\n2、If you notice a delay when the cursor moves, try adjusting the resolution or switching to a higher-performance phone, then retest.\n\n3、If the cursor randomly flickers to different positions or cannot move, please click on ambient light measurement to locate the interference source and block it.",

+ 1 - 1
Assets/BowArrow/Scripts/Expand/AutoResetView.cs

@@ -62,7 +62,7 @@ public class AutoResetView : MonoBehaviour
 
       AutoResetView autoResetView =  Instantiate(Resources.Load<GameObject>("Prefabs/Views/AutoResetView")).GetComponent<AutoResetView>();
       autoResetView.bInfraredGuider = true;
-      autoResetView.infraredGuiderTime = GlobalData.MyDeviceMode == DeviceMode.Gun ? 5 : 10;
+      autoResetView.infraredGuiderTime = GlobalData.MyDeviceMode == DeviceMode.Gun ? CommonConfig.calibrationTimeGun : CommonConfig.calibrationTimeArchery;
     }
 
     /// <summary>

+ 5 - 1
Assets/BowArrow/Scripts/Game/CrossHair.cs

@@ -33,7 +33,11 @@ public class CrossHair : MonoBehaviour
         SetOpen(UserSettings.ins.openCrossHair);
         //如果是靶子场景,把准心改为黑色
         if (SceneManager.GetActiveScene().name.Equals("Game")) {
-            this.image.color = Color.black;
+            //弓箭还是默认黑色图标
+            if (GlobalData.MyDeviceMode == DeviceMode.Archery)
+            {
+                this.image.color = Color.black;
+            }
 
             infraredGuiderObj =  FindObjectOfType<InfraredGuider>()?.gameObject;
         }

+ 2 - 1
Assets/SmartBow/Scripts/Views/InfraredViewParts/PointMarker.cs

@@ -44,6 +44,7 @@ public class PointMarker : MonoBehaviour
 
     void Update()
     {
+#if UNITY_EDITOR
         if (Input.GetKeyDown(KeyCode.Alpha6))
         {
             //Vector2 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
@@ -60,8 +61,8 @@ public class PointMarker : MonoBehaviour
             // 设置标记的位置
             MarkPoint(new Vector2(u, v).pixelToLocalPosition_AnchorCenter(new Vector2(1, 1), markerParent.GetComponent<RectTransform>().rect));
         }
+#endif
     }
-
     /// <summary>
     /// 记录红外点
     /// </summary>