Преглед изворни кода

1.修改重置前line渲染同步。修改校准时候文字区分。修改水果游戏按钮bug

slambb пре 1 година
родитељ
комит
be5cf99776

+ 7 - 1
Assets/BowArrow/InfraredCamera/InfraredDemo.cs

@@ -581,7 +581,13 @@ public class InfraredDemo : MonoBehaviour
                 Debug.Log("OnUVCPosUpdate");
                  SetLocatePointsToCameraRender(list, 1, 1);
                 //InfraredScreenPositioningView 页面
-                if(list.Count == 4) FindObjectOfType<InfraredScreenPositioningView>()?.SyncScreenPosition();
+                if (list.Count == 4)
+                {
+                    FindObjectOfType<InfraredScreenPositioningView>()?.SyncScreenPosition();
+                }
+                else {
+                    FindObjectOfType<InfraredScreenPositioningView>()?.onReset();
+                }
             };
         }
     }

+ 107 - 5
Assets/BowArrow/Resources/Prefabs/Views/AutoResetView.prefab

@@ -28,6 +28,7 @@ RectTransform:
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
   m_Children: []
   m_Father: {fileID: 8541278423340140544}
   m_RootOrder: 0
@@ -93,7 +94,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &1490023618661034890
 RectTransform:
   m_ObjectHideFlags: 0
@@ -104,14 +105,15 @@ RectTransform:
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
   m_Children: []
   m_Father: {fileID: 4272915218284800337}
   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: 0}
+  m_AnchorMin: {x: 0, y: 1}
+  m_AnchorMax: {x: 0, y: 1}
+  m_AnchoredPosition: {x: 60, y: -59.692307}
+  m_SizeDelta: {x: 0, y: 39.384613}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &1135559010089599251
 CanvasRenderer:
@@ -200,8 +202,10 @@ RectTransform:
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
   m_Children:
   - {fileID: 1490023618661034890}
+  - {fileID: 8982683736172860906}
   m_Father: {fileID: 8541278423340140544}
   m_RootOrder: 1
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -288,6 +292,102 @@ MonoBehaviour:
   m_EditorClassIdentifier: 
   m_HorizontalFit: 2
   m_VerticalFit: 2
+--- !u!1 &6490766110024425727
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 8982683736172860906}
+  - component: {fileID: 5530245847748039100}
+  - component: {fileID: 8084116690311064293}
+  - component: {fileID: 6327155816790994373}
+  m_Layer: 5
+  m_Name: Text-Infrared
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 0
+--- !u!224 &8982683736172860906
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 6490766110024425727}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 4272915218284800337}
+  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: 60, y: -59.692307}
+  m_SizeDelta: {x: 0, y: 39.384613}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &5530245847748039100
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 6490766110024425727}
+  m_CullTransparentMesh: 1
+--- !u!114 &8084116690311064293
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 6490766110024425727}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 0
+  m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
+  m_Maskable: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+  m_FontData:
+    m_Font: {fileID: 12800000, guid: 1ad2cf6c2f09744489d8c60b3fe3bab2, type: 3}
+    m_FontSize: 30
+    m_FontStyle: 0
+    m_BestFit: 0
+    m_MinSize: 2
+    m_MaxSize: 40
+    m_Alignment: 3
+    m_AlignByGeometry: 0
+    m_RichText: 1
+    m_HorizontalOverflow: 0
+    m_VerticalOverflow: 0
+    m_LineSpacing: 1
+  m_Text: 
+--- !u!114 &6327155816790994373
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 6490766110024425727}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 0f4efe98aab6c6b41a7ee1f4c49df27b, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  textKey: "new-user-guider_tip_\u89C6\u89D2\u5F52\u4F4D-\u7784\u51C6-infrared"
+  layoutRebuildObject: {fileID: 0}
+  languageFontSizes: []
 --- !u!1 &8541278423340140556
 GameObject:
   m_ObjectHideFlags: 0
@@ -318,6 +418,7 @@ RectTransform:
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 0, y: 0, z: 0}
+  m_ConstrainProportionsScale: 0
   m_Children:
   - {fileID: 5753555721075870674}
   - {fileID: 4272915218284800337}
@@ -346,6 +447,7 @@ Canvas:
   m_OverrideSorting: 0
   m_OverridePixelPerfect: 0
   m_SortingBucketNormalizedSize: 0
+  m_VertexColorAlwaysGammaSpace: 0
   m_AdditionalShaderChannelsFlag: 0
   m_SortingLayerID: 0
   m_SortingOrder: 3

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

@@ -126,6 +126,7 @@
   "new-user-guider_tip_限时游戏-选择距离": "选择距离<color=#FFA500>“10米”</color>开始游戏吧!",
   "new-user-guider_tip_视角归位-触发": "短按模块上的<color=#FFA500>“视角归位”</color>键,<color=#FFA500>参考图中\n姿势将弓箭瞄准靶心</color>,3秒后完成视角归位。",
   "new-user-guider_tip_视角归位-瞄准": "请参考图中姿势,立即瞄准靶心,\n<size=40><color=#FFA500>{0}</color></size>秒后完成视角归位。",
+  "new-user-guider_tip_视角归位-瞄准-infrared": "请参考图中姿势,以箭筒头部为参考点,\n立即瞄准靶心,<size=40><color=#FFA500>{0}</color></size>秒后完成准心校准。",
   "new-user-guider_tip_教程结束": "恭喜您完成了本次新手教程,下次如果还\n要<color=#FFA500>了解本教程</color>,请在<color=#FFA500>设置中查看新手指导</color>。",
   "new-user-guider_tip_准心高亮": "请按提示向箭靶上射中一箭后,\n完成本次手动设置,并回到连接页面。",
   "new-user-guider_btn_ok": "确定",

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

@@ -127,6 +127,7 @@
   "new-user-guider_tip_限时游戏-选择距离": "Choose <color=#FFA500>\"10M\"</color> to start the game!",
   "new-user-guider_tip_视角归位-触发": "Short press the <color=#FFA500>\"Aim Reset\"</color> \nkey on the module, <color=#FFA500>aim the bow \nand arrow at the bull's eye with \nreference to the posture in the \npicture</color>, and then complete the \nvisual angle return in 3 seconds.",
   "new-user-guider_tip_视角归位-瞄准": "Please refer to the pose in the figure, aim \nat the bull's-eye immediately, the visual \nangle return will be completed in <size=40><color=#FFA500>{0}</color></size> seconds.",
+  "new-user-guider_tip_视角归位-瞄准-infrared": "Please refer to the posture in the image, using the arrowhead as a reference point, \nand aim at the target center immediately.<size=40><color=#FFA500>{0}</color></size> seconds later, the crosshair calibration will be completed.",
   "new-user-guider_tip_教程结束": "Congratulations on completing this novice tutorial. If you want \nto <color=#FFA500>know this tutorial</color> next time, please <color=#FFA500>see the novice guidance \nin the setup.</color>",
   "new-user-guider_tip_准心高亮": "Please follow the prompts to \nshoot an arrow towards the \ntarget, complete the manual \nsetup, and return to the \nconnection page.",
   "new-user-guider_btn_ok": "OK",

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

@@ -117,7 +117,20 @@ public class AutoResetView : MonoBehaviour
 
     TextAutoLanguage2 _guideTip;
     TextAutoLanguage2 GetGuideTip() {
-        if (_guideTip == null) _guideTip = transform.Find("FrameTip").GetComponentInChildren<TextAutoLanguage2>();
+        if (_guideTip == null) {
+            if (AimHandler.ins.bRuning9Axis())
+            {
+                Transform text = transform.Find("FrameTip/Text");
+                text.gameObject.SetActive(true);
+                _guideTip = text.GetComponentInChildren<TextAutoLanguage2>();
+            }
+            else {
+                Transform textInfrared = transform.Find("FrameTip/Text-Infrared");
+                textInfrared.gameObject.SetActive(true);
+                _guideTip = textInfrared.GetComponentInChildren<TextAutoLanguage2>();
+            }
+             
+        }
         return _guideTip;
     }
 }

+ 4 - 3
Assets/FruitMaster/Scripts/OverallLogics.cs

@@ -47,7 +47,7 @@ public class OverallLogics : MonoBehaviour
             //获取设置值和一个存储值
             bool onInitOpen = InfraredDemo._ins? InfraredDemo._ins.bInitCrosshairShow():true;
             Debug.Log("onInitOpen:"+ onInitOpen);
-            Image crossHairImage = CrossHairBtn.gameObject.GetComponent<Image>();
+            Image crossHairImage = CrossHairBtn.transform.Find("Image").GetComponent<Image>();
             crossHairImage.material = onInitOpen ? outlight : null;
             //StartGame 控制 AimingCross_img
     
@@ -71,7 +71,8 @@ public class OverallLogics : MonoBehaviour
             //校准
             CalibrationOffsetBtn.onClick.AddListener(delegate () {
                 AudioMgr.ins.PlayBtn();
-                ResetAim();
+                GetComponent<SmartBowManager>().ResetAim();
+                //ResetAim();
             });
         }
         else
@@ -122,7 +123,7 @@ public class OverallLogics : MonoBehaviour
         //关闭9轴按钮
         ResetAimBtn.gameObject.SetActive(false);
 
-        Image crossHairImage = CrossHairBtn.gameObject.GetComponent<Image>();
+        Image crossHairImage = CrossHairBtn.transform.Find("Image").GetComponent<Image>();
 
         bool onlyShow = JCFruitMaster.ins.GetOnlyShow();