Bladeren bron

整合调整了 SmartArcheryView 简单流程

slambb 2 jaren geleden
bovenliggende
commit
2d6ae53aeb

+ 1 - 0
Assets/BowArrow/Scripts/Bluetooth/AimHandler.cs

@@ -8,6 +8,7 @@ public enum AimDeviceType {
     HOUYI = 0,
     HOUYI2 = 1,
     ARTEMIS = 2,
+    HOUYIPRO = 3,
 }
 
 

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

@@ -397,7 +397,7 @@
   "Guidance_Title": "连接指南",
   "Guidance_Step1": "电源按钮位于3.5毫米信号插孔附近。",
   "Guidance_Step2": "要打开或关闭设备,请按住电源按钮约3秒钟。",
-  "Guidance_Step3": "当绿灯缓慢闪烁时,意味着设备已打开并准备好连接到应用程序。",
+  "Guidance_Step3": "当绿灯缓慢闪烁时,意味着设备已打开并准备好连接到应用程序。\n并将模块安装到设备上。",
   "Guidance_Check": "确认完成上述步骤",
   "Guidance_Checked": "请勾选确认完成上述步骤",
 
@@ -497,6 +497,13 @@
   "Result-ShootUnit": "arr.",
   "Result-CaloriesLabel": "燃烧卡路里",
   "Result-CaloriesUnit": "kcal",
-  "Result-Button": "再次点击或点击退出"
+  "Result-Button": "再次点击或点击退出",
 
+
+  /**
+   红外定位部分
+  **/
+  "Infrared-ScreenPositioning": "进入手动定位屏幕",
+  "Infrared-Step1": "使摄像头位于电视的前方,旋转摄像头使其朝向电视屏幕。",
+  "Infrared-Step2": "调整摄像头位置,确保可以拍摄到电视的四角 \n并使电视尽量占满画面,旋转相机镜头可对焦。\n\n严格按照数字顺序依次拖动 \n相机只需定位一次,只要不移动位置,就无需再定位 \n\n找出画面里显示屏的4个角按照数字顺序依次点击进行位置标注。请注意不是画面红色区域数字位置的4个角,而是画面里的显示屏的4个角。"
 }

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

@@ -446,7 +446,7 @@
   "Guidance_Title": "Connection Guidance",
   "Guidance_Step1": "Power button is located near the 3.5mm signal jack.",
   "Guidance_Step2": "To turn the device on or off, press and hold the power button for approximately 3 seconds.",
-  "Guidance_Step3": "When the green light flashes slowly, it means the device is on and ready to connect to the app.",
+  "Guidance_Step3": "When the green light flashes slowly, it means the device is on and ready to connect to the app.\n And install the module onto the device.",
   "Guidance_Check": "Confirmed the completion of the above steps",
   "Guidance_Checked": "Please check to confirm completion of the above steps",
 
@@ -548,5 +548,12 @@
   "Result-ShootUnit": "arr.",
   "Result-CaloriesLabel": "Calories Burned",
   "Result-CaloriesUnit": "kcal",
-  "Result-Button": "Tap  or click  again  to quit"
+  "Result-Button": "Tap  or click  again  to quit",
+
+  /**
+   红外定位部分
+  **/
+  "Infrared-ScreenPositioning": "Positioning Screen",
+  "Infrared-Step1": "Place the camera in front of the TV and rotate it to face the TV screen.",
+  "Infrared-Step2": "Adjust the camera position to ensure that the four corners of the TV can be captured \n And make the TV as full as possible, rotate the camera lens to focus.\n\nStrictly drag in numerical order \nThe camera only needs to be positioned once, as long as it does not move, there is no need for further positioning \n\nIdentify the four corners of the display screen in numerical order and click to mark their positions. Please note that it is not the four corners of the number positions in the red area of the screen, but the four corners of the display screen in the screen."
 }

+ 11 - 2
Assets/BowArrow/Scripts/View/Home/SmartArcheryView.cs

@@ -53,9 +53,13 @@ public class SmartArcheryView  : JCUnityLib.ViewBase
                 {
                     AimHandler.ins.SetTempAimDeviceType(AimDeviceType.HOUYI2);
                 }
-                else if (index == 2) {
+                else if (index == 2)
+                {
                     AimHandler.ins.SetTempAimDeviceType(AimDeviceType.ARTEMIS);
                 }
+                else if (index == 3) {
+                    AimHandler.ins.SetTempAimDeviceType(AimDeviceType.HOUYIPRO);
+                }
                 //_white = new Color32(255, 255, 255, 255);
                 _buttonTitle = new Color32(16, 194, 198, 255);
                 _button.transform.Find("right/arrow").GetComponent<Image>().sprite = arrowImages[1];
@@ -77,7 +81,12 @@ public class SmartArcheryView  : JCUnityLib.ViewBase
         {
             //进入选中的页面
             AudioMgr.ins.PlayBtn();
-            ViewManager2.ShowView(ViewManager2.Path_ConnectGuidanceView);
+            if (index == 3) {
+                //进入红外引导界面
+                ViewManager2.ShowView(ViewManager2.Path_InfraredView);
+            } else {
+                ViewManager2.ShowView(ViewManager2.Path_ConnectGuidanceView);
+            }
         }
 
     }

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

@@ -2770,7 +2770,6 @@ GameObject:
   - component: {fileID: 213060852178376601}
   - component: {fileID: 4859593515274267305}
   - component: {fileID: 3128554242021740522}
-  - component: {fileID: 2773401179020287081}
   m_Layer: 5
   m_Name: TextTip
   m_TagString: Untagged
@@ -2840,21 +2839,6 @@ MonoBehaviour:
     m_VerticalOverflow: 1
     m_LineSpacing: 1
   m_Text: "\u8BF7\u6309\u7167\u4E0A\u4E00\u6B65\u7684\u8981\u6C42\u8C03\u6574\u76F8\u673A\u4F4D\u7F6E\n\u53F3\u4FA7\u6ED1\u6761\u53EF\u8C03\u6574\u753B\u9762\u4EAE\u5EA6"
---- !u!114 &2773401179020287081
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 6474032259244959646}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 0f4efe98aab6c6b41a7ee1f4c49df27b, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  textKey: Gyro_Step1
-  layoutRebuildObject: {fileID: 0}
-  languageFontSizes: []
 --- !u!1 &6607547226471776927
 GameObject:
   m_ObjectHideFlags: 0

+ 35 - 33
Assets/SmartBow/Resources/SmartBow/Prefabs/Views/Home/InfraredView.prefab

@@ -40,7 +40,7 @@ RectTransform:
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 0, y: 1}
   m_AnchoredPosition: {x: 1266, y: -782.8325}
-  m_SizeDelta: {x: 0, y: 96}
+  m_SizeDelta: {x: 444, y: 96}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &7197677582152048619
 CanvasRenderer:
@@ -126,7 +126,7 @@ MonoBehaviour:
       m_Calls:
       - m_Target: {fileID: 8339594333699129169}
         m_TargetAssemblyTypeName: InfraredGuidanceView, Assembly-CSharp
-        m_MethodName: OnClick_Enter
+        m_MethodName: OnClick_EnterScreenPositioningView
         m_Mode: 1
         m_Arguments:
           m_ObjectArgument: {fileID: 0}
@@ -211,9 +211,9 @@ RectTransform:
   m_Father: {fileID: 6541729197459587817}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
-  m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 0, y: 0}
-  m_AnchoredPosition: {x: 0, y: 0}
+  m_AnchorMin: {x: 0, y: 1}
+  m_AnchorMax: {x: 0, y: 1}
+  m_AnchoredPosition: {x: 1266, y: -320}
   m_SizeDelta: {x: 1668.06, y: 640}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &462368352428713268
@@ -365,10 +365,10 @@ RectTransform:
   m_Father: {fileID: 1730599641784995024}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
-  m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 0, y: 0}
-  m_AnchoredPosition: {x: 0, y: 0}
-  m_SizeDelta: {x: 0, y: 50}
+  m_AnchorMin: {x: 0, y: 1}
+  m_AnchorMax: {x: 0, y: 1}
+  m_AnchoredPosition: {x: 221, y: -48}
+  m_SizeDelta: {x: 280, y: 50}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &2166458721827678163
 CanvasRenderer:
@@ -424,7 +424,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 0f4efe98aab6c6b41a7ee1f4c49df27b, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  textKey: 
+  textKey: Infrared-ScreenPositioning
   layoutRebuildObject: {fileID: 0}
   languageFontSizes: []
 --- !u!1 &2823352511136847493
@@ -445,7 +445,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &6748997971718369909
 RectTransform:
   m_ObjectHideFlags: 0
@@ -722,7 +722,7 @@ MonoBehaviour:
     m_AlignByGeometry: 0
     m_RichText: 1
     m_HorizontalOverflow: 0
-    m_VerticalOverflow: 0
+    m_VerticalOverflow: 1
     m_LineSpacing: 1
   m_Text: "\u8C03\u6574\u6444\u50CF\u5934\u4F4D\u7F6E\uFF0C\u786E\u4FDD\u53EF\u4EE5\u62CD\u6444\u5230\u7535\u89C6\u7684\u56DB\u89D2\n\r\u5E76\u4F7F\u7535\u89C6\u5C3D\u91CF\u5360\u6EE1\u753B\u9762\uFF0C\u65CB\u8F6C\u76F8\u673A\u955C\u5934\u53EF\u5BF9\u7126\u3002\n\r\n\r\n\u4E25\u683C\u6309\u7167\u6570\u5B57\u987A\u5E8F\u4F9D\u6B21\u53CC\u51FB\r\n\u76F8\u673A\u53EA\u9700\u5B9A\u4F4D\u4E00\u6B21\uFF0C\u53EA\u8981\u4E0D\u79FB\u52A8\u4F4D\u7F6E\uFF0C\u5C31\u65E0\u9700\u518D\u5B9A\u4F4D
     \r\n\n\r\n\u627E\u51FA\u753B\u9762\u91CC\u663E\u793A\u5C4F\u76844\u4E2A\u89D2\u6309\u7167\u6570\u5B57\u987A\u5E8F\u4F9D\u6B21\u70B9\u51FB\u8FDB\u884C\u4F4D\u7F6E\u6807\u6CE8\u3002\u8BF7\u6CE8\u610F\u4E0D\u662F\u753B\u9762\u7EA2\u8272\u533A\u57DF\u6570\u5B57\u4F4D\u7F6E\u76844\u4E2A\u89D2\uFF0C\u800C\u662F\u753B\u9762\u91CC\u7684\u663E\u793A\u5C4F\u76844\u4E2A\u89D2\u3002"
@@ -738,7 +738,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 0f4efe98aab6c6b41a7ee1f4c49df27b, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  textKey: Gyro_Step1
+  textKey: Infrared-Step2
   layoutRebuildObject: {fileID: 0}
   languageFontSizes: []
 --- !u!1 &5651314242315564802
@@ -860,6 +860,8 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 3798811bdfbbb1d43aa4552fad5f8cab, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  layout1: {fileID: 5651314243503148116}
+  layout2: {fileID: 6681263876151103114}
 --- !u!1 &5651314242354419832
 GameObject:
   m_ObjectHideFlags: 0
@@ -1360,7 +1362,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 0f4efe98aab6c6b41a7ee1f4c49df27b, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  textKey: Gyro_Title
+  textKey: Guidance_Title
   layoutRebuildObject: {fileID: 0}
   languageFontSizes: []
 --- !u!1 &5651314243503148116
@@ -1382,7 +1384,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 0
+  m_IsActive: 1
 --- !u!224 &5651314243503148123
 RectTransform:
   m_ObjectHideFlags: 0
@@ -1403,7 +1405,7 @@ RectTransform:
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 1, y: 1}
   m_AnchoredPosition: {x: 0, y: -78.17999}
-  m_SizeDelta: {x: -1195, y: -404}
+  m_SizeDelta: {x: 0, y: 0}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &5651314243503148127
 CanvasRenderer:
@@ -1427,9 +1429,9 @@ MonoBehaviour:
   m_EditorClassIdentifier: 
   m_Material: {fileID: 0}
   m_Color: {r: 1, g: 0, b: 0, a: 1}
-  m_RaycastTarget: 1
+  m_RaycastTarget: 0
   m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
-  m_Maskable: 1
+  m_Maskable: 0
   m_OnCullStateChanged:
     m_PersistentCalls:
       m_Calls: []
@@ -1517,9 +1519,9 @@ RectTransform:
   m_Father: {fileID: 5651314243503148123}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
-  m_AnchorMin: {x: 0, y: 1}
-  m_AnchorMax: {x: 0, y: 1}
-  m_AnchoredPosition: {x: 668.5, y: -320}
+  m_AnchorMin: {x: 0, y: 0}
+  m_AnchorMax: {x: 0, y: 0}
+  m_AnchoredPosition: {x: 0, y: 0}
   m_SizeDelta: {x: 1337, y: 640}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &5651314243550147655
@@ -1653,7 +1655,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 0f4efe98aab6c6b41a7ee1f4c49df27b, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  textKey: Gyro_Step1
+  textKey: Infrared-Step1
   layoutRebuildObject: {fileID: 0}
   languageFontSizes: []
 --- !u!1 &5651314243985302723
@@ -1690,10 +1692,10 @@ RectTransform:
   m_Father: {fileID: 5651314244108234268}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
-  m_AnchorMin: {x: 0, y: 1}
-  m_AnchorMax: {x: 0, y: 1}
-  m_AnchoredPosition: {x: 221, y: -48}
-  m_SizeDelta: {x: 140, y: 50}
+  m_AnchorMin: {x: 0, y: 0}
+  m_AnchorMax: {x: 0, y: 0}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 0, y: 50}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &5651314243985302727
 CanvasRenderer:
@@ -1749,7 +1751,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 0f4efe98aab6c6b41a7ee1f4c49df27b, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  textKey: 
+  textKey: common_next
   layoutRebuildObject: {fileID: 0}
   languageFontSizes: []
 --- !u!1 &5651314244108234269
@@ -1789,10 +1791,10 @@ RectTransform:
   m_Father: {fileID: 5651314243503148123}
   m_RootOrder: 1
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
-  m_AnchorMin: {x: 0, y: 1}
-  m_AnchorMax: {x: 0, y: 1}
-  m_AnchoredPosition: {x: 668.5, y: -718}
-  m_SizeDelta: {x: 444, y: 96}
+  m_AnchorMin: {x: 0, y: 0}
+  m_AnchorMax: {x: 0, y: 0}
+  m_AnchoredPosition: {x: 668.5, y: 0}
+  m_SizeDelta: {x: 0, y: 96}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &5651314244108234247
 CanvasRenderer:
@@ -1878,7 +1880,7 @@ MonoBehaviour:
       m_Calls:
       - m_Target: {fileID: 8339594333699129169}
         m_TargetAssemblyTypeName: InfraredGuidanceView, Assembly-CSharp
-        m_MethodName: OnClick_Enter
+        m_MethodName: OnClick_EnterLayout2
         m_Mode: 1
         m_Arguments:
           m_ObjectArgument: {fileID: 0}
@@ -1944,7 +1946,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &6541729197459587817
 RectTransform:
   m_ObjectHideFlags: 0

+ 13 - 4
Assets/SmartBow/Scripts/Views/ConnectGuidanceView.cs

@@ -64,8 +64,12 @@ public class ConnectGuidanceView : MonoBehaviour
             if (bowStatus == BluetoothStatusEnum.ConnectSuccess)
             {
                 AimHandler.ins.OnSaveAimDeviceInfos();
-                ViewManager2.HideView(ViewManager2.Path_ConnectGuidanceView);
-                ViewManager2.ShowView(ViewManager2.Path_GyrGuidanceView);
+                if (AimHandler.ins.aimDeviceInfo.type != (int)AimDeviceType.HOUYIPRO) 
+                {
+                    //如果不是红外设备,才进入校准?
+                    ViewManager2.HideView(ViewManager2.Path_ConnectGuidanceView);
+                    ViewManager2.ShowView(ViewManager2.Path_GyrGuidanceView);
+                }
             }
         }
         else if (BluetoothAim.ins.getBLEPlayer() == BluetoothPlayer.SECONDE_PLAYER)
@@ -73,8 +77,13 @@ public class ConnectGuidanceView : MonoBehaviour
             if (bowStatus2P == SmartBowSDK.BluetoothStatusEnum.Connected)
             {
                 AimHandler.ins.OnSaveAimDeviceInfos();
-                ViewManager2.HideView(ViewManager2.Path_ConnectGuidanceView);
-                ViewManager2.ShowView(ViewManager2.Path_GyrGuidanceView);
+                if (AimHandler.ins.aimDeviceInfo.type != (int)AimDeviceType.HOUYIPRO)
+                {
+                    //如果不是红外设备,才进入校准?
+                    ViewManager2.HideView(ViewManager2.Path_ConnectGuidanceView);
+                    ViewManager2.ShowView(ViewManager2.Path_GyrGuidanceView);
+                }
+                //ViewManager2.ShowView(ViewManager2.Path_GyrGuidanceView);
             }
         }
     }

+ 14 - 4
Assets/SmartBow/Scripts/Views/InfraredViewParts/InfraredGuidanceView.cs

@@ -4,21 +4,31 @@ using UnityEngine;
 
 public class InfraredGuidanceView  : JCUnityLib.ViewBase
 {
+    [SerializeField]
+    GameObject layout1;
+    [SerializeField]
+    GameObject layout2;
     // Start is called before the first frame update
     void Start()
     {
         
     }
 
-    public void OnClick_Enter() {
+    public void OnClick_EnterLayout2() {
         //进入标定的页面
         AudioMgr.ins.PlayBtn();
-        ViewManager2.ShowView(ViewManager2.Path_InfraredGuidanceViewCalibration);
+        layout1.SetActive(false);
+        layout2.SetActive(true);
+    }
+    public void OnClick_EnterScreenPositioningView()
+    {
+        //进入标定的页面
+        AudioMgr.ins.PlayBtn();
+        ViewManager2.ShowView(ViewManager2.Path_InfraredScreenPositioningView);
     }
-
     public void OnClick_Back()
     {
         AudioMgr.ins.PlayBtn();
-        ViewMgr.Instance.DestroyView<InfraredGuidanceView>();
+        ViewManager2.HideView(ViewManager2.Path_InfraredView);
     }
 }

+ 5 - 0
Assets/SmartBow/Scripts/Views/InfraredViewParts/InfraredScreenPositioningView.cs

@@ -154,6 +154,11 @@ public class InfraredScreenPositioningView  : JCUnityLib.ViewBase
         }
 
 
+        //跳转入界面
+        AudioMgr.ins.PlayBtn();
+        ViewManager2.HideView(ViewManager2.Path_InfraredScreenPositioningView);
+        ViewManager2.ShowView(ViewManager2.Path_ConnectGuidanceView);
+
     }
 
     //设置位置

+ 2 - 2
Assets/SmartBow/Scripts/Views/ViewManager2.cs

@@ -68,8 +68,8 @@ public class ViewManager2
     public const string Path_GyrGuidanceView = "Home/GyrGuidanceView";
     public const string Path_MagGuidanceView = "Home/MagGuidanceView";
 
-    public const string Path_InfraredGuidanceView = "Home/InfraredGuidanceView";
-    public const string Path_InfraredGuidanceViewCalibration = "Home/InfraredGuidanceViewCalibration";
+    public const string Path_InfraredView = "Home/InfraredView";
+    public const string Path_InfraredScreenPositioningView = "Home/InfraredScreenPositioningView";
 
     public const string Path_HomeViewTip = "Home/HomeView_Tip";
     public const string Path_GameResultView = "GameResultView";