Browse Source

引导调整

lvjincheng 3 years ago
parent
commit
0f5d6df89e

+ 11 - 8
Assets/BowArrow/Modules/NewUserGuider/HollowOutMask.cs

@@ -127,12 +127,15 @@ public class HollowOutMask : MaskableGraphic, ICanvasRaycastFilter
         base.Awake();
         _cacheTrans = GetComponent<RectTransform>();
     }
-    
-    // #if UNITY_EDITOR
-    // void Update()
-    // {
-    //     _canRefresh = true;
-    //     _RefreshView();
-    // }
-    // #endif
+
+    [SerializeField] public bool autoUpdate = false;   
+    private float _lastAutoUpdateTime = 0;
+    void Update()
+    {
+        if (autoUpdate && Time.realtimeSinceStartup - _lastAutoUpdateTime > 0.2f) {
+            _lastAutoUpdateTime = Time.realtimeSinceStartup;
+            _canRefresh = true;
+            _RefreshView();
+        }
+    }
 }

+ 8 - 4
Assets/BowArrow/Modules/NewUserGuider/NewUserGuiderManager.cs

@@ -106,7 +106,6 @@ public class NewUserGuiderManager : MonoBehaviour
         config = new NewUserGuiderConfig();
         config.key = "连接设备";
         config.frameTipPivot = "lb";
-        config.frameTipText = TextAutoLanguage2.GetTextByKey("new-user-guider_tip_" + config.key);
         config.onPrepare = (g) => {
             RectTransform btn = GameObject.Find("HomeView/HomeViewRenderBow/Btn").GetComponent<RectTransform>();
             g.hollowOutMask.SetTarget(btn);
@@ -116,6 +115,7 @@ public class NewUserGuiderManager : MonoBehaviour
             g.config.hitPos = btn.position;
             g.config.pointerPos = btn.position + RectTransformUtils.CanvasV3ToScreenV3(Vector3.up * 80f, btn);
             g.config.frameTipPos = btn.position + RectTransformUtils.CanvasV3ToScreenV3(Vector3.up * 150f, btn);
+            g.hollowOutMask.autoUpdate = true;
         };
         config.onStart = (g) => {
             g.GetMaskClickedEvent().RemoveAllListeners();
@@ -214,9 +214,13 @@ public class NewUserGuiderManager : MonoBehaviour
             Action onclickTarget = () => {
                 g.gameObject.SetActive(false);
                 DeviceCalibrateView.ins.action_OnDestroy += () => {
-                    FindObjectOfType<DeviceView1>()?.OnClick_Back();
-                    g.clickedWillPlayAudioBtn = false;
-                    g.OnClick_ToNext();
+                    if (AimHandler.ins.MagCalibrater.Complete) {
+                        FindObjectOfType<DeviceView1>()?.OnClick_Back();
+                        g.clickedWillPlayAudioBtn = false;
+                        g.OnClick_ToNext();
+                    } else {
+                        g.gameObject.SetActive(true);
+                    }
                 };
             };
             DeviceView1.ins.action_OnClickMag += onclickTarget;