Browse Source

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

# Conflicts:
#	Assets/BowArrow/InfraredCamera/InfraredDemo.cs
添加了一个捕获操作,和修改文字流程
slambb 11 tháng trước cách đây
mục cha
commit
d640240944

+ 38 - 0
Assets/BowArrow/InfraredCamera/InfraredDemo.cs

@@ -55,6 +55,11 @@ public class InfraredDemo : JCUnityLib.ViewBase
         GameObject obj = UserPlayer.InitReturnLogReporter() as GameObject;
         if (obj != null) {
             reporter = obj.GetComponent<Reporter>();
+            Application.logMessageReceived += HandleLog;
+            // 模拟错误日志
+            //Debug.LogError("Test Error: This is a simulated error message.");
+            // 模拟异常日志
+            //Debug.LogException(new System.Exception("Test Exception: This is a simulated exception."));
         }
 
         if (Application.platform != RuntimePlatform.WindowsEditor) DebugInEditor = false;
@@ -83,6 +88,10 @@ public class InfraredDemo : JCUnityLib.ViewBase
         _calibrationFixedText.transform.parent.gameObject.SetActive(false);
 #endif
     }
+    void OnDestroy()
+    {
+        if(reporter!= null) Application.logMessageReceived -= HandleLog;
+    }
 
     void OnGUI()
     {
@@ -1773,6 +1782,35 @@ public class InfraredDemo : JCUnityLib.ViewBase
     }
 #endregion
 
+    
+    #region 错误日志
+   public  void HandleLog(string logString, string stackTrace, LogType type)
+    {
+        if (type == LogType.Exception || type == LogType.Error)
+        {
+            SaveLogToFile(logString, stackTrace);
+        }
+    }
+
+    void SaveLogToFile(string message, string stackTrace)
+    {
+        string path;
+
+#if UNITY_ANDROID && !UNITY_EDITOR_WIN
+        // 保存到 Android 的公共 Download 文件夹,便于用户直接查看
+        path = System.IO.Path.Combine("/storage/emulated/0/Download", "crash_log.txt");
+#else
+        // 其他平台使用 Application.persistentDataPath
+        path = System.IO.Path.Combine(Application.persistentDataPath, "crash_log.txt");
+#endif
+        // 打印路径确认
+        Debug.Log($"Log file saved at: {path}");
+        // 将日志写入到指定路径的文件中
+        System.IO.File.AppendAllText(path, $"{message}\n{stackTrace}\n\n");
+    }
+
+    #endregion
+
 }
 public class ParamFloatValue
 {

+ 5 - 5
Assets/BowArrow/InfraredCamera/Resources/InfraredDemo.prefab

@@ -9599,11 +9599,11 @@ RectTransform:
   m_Father: {fileID: 7795906586411487646}
   m_RootOrder: 6
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
-  m_AnchorMin: {x: 0, y: 1}
-  m_AnchorMax: {x: 0, y: 1}
-  m_AnchoredPosition: {x: 35, y: -40}
-  m_SizeDelta: {x: 320, y: 60}
-  m_Pivot: {x: 0, y: 1}
+  m_AnchorMin: {x: 0.5, y: 0}
+  m_AnchorMax: {x: 0.5, y: 0}
+  m_AnchoredPosition: {x: 0, y: 18.909973}
+  m_SizeDelta: {x: 400, y: 60}
+  m_Pivot: {x: 0.5, y: 0}
 --- !u!222 &523407382556651653
 CanvasRenderer:
   m_ObjectHideFlags: 0

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

@@ -561,6 +561,7 @@
   "ManualSetting": "手动设置",
   "Confirm": "确认",
   "Finish": "完成",
+  "MarkCompleted": "标记完成",
   "Reset": "重置",
   "ReAutoPositioning": "重新自动定位",
   "ReScreenMarking": "重新屏幕标记",
@@ -572,9 +573,9 @@
   "TitleTipMarker-HOUYIPro": "HOUYI Pro瞄准模块",
   "TitleTipMarker-ArtemisPro": "Artemis Pro",
   "TitleTipMarker-M9": "操作M9手枪依次瞄准屏幕的四个角\n扣动扳机进行标记(四角位置标签)",
-  "TitleTipMarker2": "操作瞄准器设备对准电视,按提示依次用红外光点瞄准摄像头中显示区域内白框的四个角,{0}\n① 如白框与电视屏幕显示区域位置一致,点击“完成”按键\n② 如标记中发现白框与电视屏幕显示区域差异较大,点击“自动定位”按键,\n重新进行自动识别\n③ 如多次自动识别无效后,点击“手动设置”按键,进入手动设置方式",
-  "TitleTipMarker2-Common": "单击瞄准器的准心键进行标记",
-  "TitleTipMarker2-ArtemisPro": "单击瞄准器的按键进行标记",
+  "TitleTipMarker2": "操作瞄准器设备对准电视,按提示依次用红外光点瞄准摄像头中显示区域内白框的四个角,{0},点击“标记完成”按键。\n① 如白框与电视屏幕显示区域位置一致,点击“完成”按键\n② 如标记中发现白框与电视屏幕显示区域差异较大,点击“自动定位”按键,\n重新进行自动识别\n③ 如多次自动识别无效后,点击“手动设置”按键,进入手动设置方式",
+  "TitleTipMarker2-Common": "单击瞄准器的准心键进行标记",
+  "TitleTipMarker2-ArtemisPro": "单击瞄准器的按键进行标记",
 
   "TipMiddle": "请标记:{0}角的点",
   "TipTopLeft": "左上",

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

@@ -611,6 +611,7 @@
   "ManualSetting": "Manual Setting",
   "Confirm": "Confirm",
   "Finish": "Finish",
+  "MarkCompleted": "Mark Complete",
   "Reset": "Reset",
   "ReAutoPositioning": "Re-Auto Positioning",
   "ReScreenMarking": "Re-Screen Marking",
@@ -622,9 +623,9 @@
   "TitleTipMarker-HOUYIPro": "HOUYI Pro Aiming Module",
   "TitleTipMarker-ArtemisPro": "Artemis Pro",
   "TitleTipMarker-M9": "Operate M9 pistol to aim at the four corners of the screen \nin sequence, pull the trigger to mark (four corner position label)",
-  "TitleTipMarker2": "Operate the aiming device to face the TV. Use the infrared light dot to aim at the four corners of the white frame displayed in the camera's view, {0}.\n① If the white frame matches the TV screen display area, click the 'Finish' button.\n② If there is a significant difference between the white frame and the TV screen display area during marking, click the 'Auto Positioning' button to reattempt automatic detection.\n③ If automatic detection fails multiple times, click the 'Manual Setup' button to enter manual setup mode.",
-  "TitleTipMarker2-Common": "Click the aiming device's crosshair button to mark.",
-  "TitleTipMarker2-ArtemisPro": "Click the aiming device's button to mark.",
+  "TitleTipMarker2": "Operate the aiming device to face the TV. Use the infrared light dot to aim at the four corners of the white frame displayed in the camera's view, {0},Click the 'Mark Completed' button.\n① If the white frame matches the TV screen display area, click the 'Finish' button.\n② If there is a significant difference between the white frame and the TV screen display area during marking, click the 'Auto Positioning' button to reattempt automatic detection.\n③ If automatic detection fails multiple times, click the 'Manual Setup' button to enter manual setup mode.",
+  "TitleTipMarker2-Common": "Click the aiming device's crosshair button to mark",
+  "TitleTipMarker2-ArtemisPro": "Click the aiming device's button to mark",
 
   "TipMiddle": "Please mark: Point at the {0} corner",
   "TipTopLeft": "Top-Left",

+ 5 - 5
Assets/SmartBow/Resources/SmartBow/Prefabs/Views/Home/InfraredScreenPositioningView.prefab

@@ -5122,7 +5122,7 @@ RectTransform:
   m_AnchorMin: {x: 0.5, y: 0.5}
   m_AnchorMax: {x: 0.5, y: 0.5}
   m_AnchoredPosition: {x: 0, y: 0}
-  m_SizeDelta: {x: 274.68, y: 137}
+  m_SizeDelta: {x: 240, y: 137}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &3032616263768982371
 CanvasRenderer:
@@ -5162,10 +5162,10 @@ MonoBehaviour:
     m_Alignment: 4
     m_AlignByGeometry: 0
     m_RichText: 1
-    m_HorizontalOverflow: 1
+    m_HorizontalOverflow: 0
     m_VerticalOverflow: 1
     m_LineSpacing: 1
-  m_Text: "\u5B8C\u6210"
+  m_Text: "\u6807\u8BB0\u5B8C\u6210"
 --- !u!114 &7666240374871244276
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -5178,7 +5178,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 0f4efe98aab6c6b41a7ee1f4c49df27b, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  textKey: Finish
+  textKey: MarkCompleted
   layoutRebuildObject: {fileID: 0}
   languageFontSizes:
   - language: 1
@@ -6103,7 +6103,7 @@ MonoBehaviour:
     m_HorizontalOverflow: 0
     m_VerticalOverflow: 1
     m_LineSpacing: 1.1
-  m_Text: "\u64CD\u4F5C\u7784\u51C6\u5668\u8BBE\u5907\u5BF9\u51C6\u7535\u89C6\uFF0C\u6309\u63D0\u793A\u4F9D\u6B21\u7528\u7EA2\u5916\u5149\u70B9\u7784\u51C6\u6444\u50CF\u5934\u4E2D\u663E\u793A\u533A\u57DF\u5185\u767D\u6846\u7684\u56DB\u4E2A\u89D2\uFF0C\u5E76\u5355\u51FB\u7784\u51C6\u5668\u7684\u51C6\u5FC3\u952E\u8FDB\u884C\u6807\u8BB0\u3002\n\u2460 
+  m_Text: "\u64CD\u4F5C\u7784\u51C6\u5668\u8BBE\u5907\u5BF9\u51C6\u7535\u89C6\uFF0C\u6309\u63D0\u793A\u4F9D\u6B21\u7528\u7EA2\u5916\u5149\u70B9\u7784\u51C6\u6444\u50CF\u5934\u4E2D\u663E\u793A\u533A\u57DF\u5185\u767D\u6846\u7684\u56DB\u4E2A\u89D2\uFF0C\u5E76\u5355\u51FB\u7784\u51C6\u5668\u7684\u51C6\u5FC3\u952E\u8FDB\u884C\u6807\u8BB0\uFF0C\u70B9\u51FB\u201C\u6807\u8BB0\u5B8C\u6210\u201D\u6309\u952E\u3002\n\u2460 
     \u5982\u767D\u6846\u4E0E\u7535\u89C6\u5C4F\u5E55\u663E\u793A\u533A\u57DF\u4F4D\u7F6E\u4E00\u81F4\uFF0C\u70B9\u51FB\u201C\u5B8C\u6210\u201D\u6309\u952E\n\u2461 
     \u5982\u6807\u8BB0\u4E2D\u53D1\u73B0\u767D\u6846\u4E0E\u7535\u89C6\u5C4F\u5E55\u663E\u793A\u533A\u57DF\u5DEE\u5F02\u8F83\u5927\uFF0C\u70B9\u51FB\u201C\u81EA\u52A8\u5B9A\u4F4D\u201D\u6309\u952E\uFF0C\n\u91CD\u65B0\u8FDB\u884C\u81EA\u52A8\u8BC6\u522B\r\n\u2462 
     \u5982\u591A\u6B21\u81EA\u52A8\u8BC6\u522B\u65E0\u6548\u540E\uFF0C\u70B9\u51FB\u201C\u624B\u52A8\u8BBE\u7F6E\u201D\u6309\u952E\uFF0C\u8FDB\u5165\u624B\u52A8\u8BBE\u7F6E\u65B9\u5F0F"