소스 검색

准心高亮

lvjincheng 3 년 전
부모
커밋
a3fea2dc92

+ 7 - 2
Assets/BowArrow/Modules/NewUserGuider/HollowOutMask.cs

@@ -56,6 +56,12 @@ public class HollowOutMask : MaskableGraphic, ICanvasRaycastFilter
             _SetTarget(bounds.min, bounds.max);
             _SetTarget(bounds.min, bounds.max);
         }
         }
     }
     }
+
+    public void RefreshViewImmediate()
+    {
+        _canRefresh = true;
+        _RefreshView();
+    }
     
     
     protected override void OnPopulateMesh(VertexHelper vh)
     protected override void OnPopulateMesh(VertexHelper vh)
     {
     {
@@ -134,8 +140,7 @@ public class HollowOutMask : MaskableGraphic, ICanvasRaycastFilter
     {
     {
         if (autoUpdate && Time.realtimeSinceStartup - _lastAutoUpdateTime > 0.2f) {
         if (autoUpdate && Time.realtimeSinceStartup - _lastAutoUpdateTime > 0.2f) {
             _lastAutoUpdateTime = Time.realtimeSinceStartup;
             _lastAutoUpdateTime = Time.realtimeSinceStartup;
-            _canRefresh = true;
-            _RefreshView();
+            RefreshViewImmediate();
         }
         }
     }
     }
 }
 }

+ 18 - 6
Assets/BowArrow/Modules/NewUserGuider/NewUserGuider.cs

@@ -29,6 +29,12 @@ public class NewUserGuider : MonoBehaviour
         action_OnDestroy?.Invoke();
         action_OnDestroy?.Invoke();
     }
     }
 
 
+    void Update()
+    {
+        action_Update?.Invoke();
+    }
+
+    public Action action_Update;
     public Action action_OnDestroy;
     public Action action_OnDestroy;
 
 
     IEnumerator ExecuteConfig()
     IEnumerator ExecuteConfig()
@@ -78,12 +84,7 @@ public class NewUserGuider : MonoBehaviour
             seq1.Append(iconPointer.DOMove(oldPos, 0.5f));
             seq1.Append(iconPointer.DOMove(oldPos, 0.5f));
             seq1.SetLoops(-1);
             seq1.SetLoops(-1);
             seq1.SetUpdate(true);
             seq1.SetUpdate(true);
-            seq2 = DOTween.Sequence();
-            Vector3 s = iconPointerHit.localScale;
-            seq2.Append(iconPointerHit.DOScale(s * 0.8f, 0.5f));
-            seq2.Append(iconPointerHit.DOScale(s, 0.5f));
-            seq2.SetLoops(-1);
-            seq2.SetUpdate(true);
+            AnimateIconPointerHit();
         }
         }
 
 
         switch (config.frameTipPivot) {
         switch (config.frameTipPivot) {
@@ -129,6 +130,17 @@ public class NewUserGuider : MonoBehaviour
         config.onStart?.Invoke(this);
         config.onStart?.Invoke(this);
     }
     }
 
 
+    public void AnimateIconPointerHit()
+    {
+        if (seq2 != null && seq2.IsActive()) seq2.Kill();
+        seq2 = DOTween.Sequence();
+        Vector3 s = iconPointerHit.localScale;
+        seq2.Append(iconPointerHit.DOScale(s * 0.8f, 0.5f));
+        seq2.Append(iconPointerHit.DOScale(s, 0.5f));
+        seq2.SetLoops(-1);
+        seq2.SetUpdate(true);
+    }
+
     public void OnClick_Skip()
     public void OnClick_Skip()
     {
     {
         AudioMgr.ins.PlayBtn();
         AudioMgr.ins.PlayBtn();

+ 47 - 5
Assets/BowArrow/Modules/NewUserGuider/NewUserGuiderManager.cs

@@ -540,11 +540,9 @@ public class NewUserGuiderManager : MonoBehaviour
             Action onClickTarget = () => {
             Action onClickTarget = () => {
                 g.gameObject.SetActive(false);
                 g.gameObject.SetActive(false);
                 AutoResetView.ins.action_OnDestroy += () => {
                 AutoResetView.ins.action_OnDestroy += () => {
-                    DoTweenUtil.CallDelay(1, () => {
-                        if (!g) return;
-                        g.clickedWillPlayAudioBtn = false;
-                        g.OnClick_ToNext();
-                    });
+                    if (!g) return;
+                    g.clickedWillPlayAudioBtn = false;
+                    g.OnClick_ToNext();
                 };
                 };
             };
             };
             GameAssistUI.ins.action_OnClickBtnIdentity += onClickTarget;
             GameAssistUI.ins.action_OnClickBtnIdentity += onClickTarget;
@@ -589,6 +587,49 @@ public class NewUserGuiderManager : MonoBehaviour
         // configs.Add(config.key, config);
         // configs.Add(config.key, config);
 
 
 
 
+        config = new NewUserGuiderConfig();
+        config.key = "准心高亮";
+        config.hitPosType = 1;
+        config.hitPos = Vector2.zero;
+        config.pointerActive = false;
+        config.frameTipText = "";
+        config.onStart = (g) => {
+            g.GetMaskClickedEvent().RemoveAllListeners();
+
+            GameMode gameMode = GameMgr.ins.gameMode;
+            if (gameMode.GetType().Equals(typeof(TimeLimitGameMode))) {
+                gameMode.PauseTimeCounting(g);
+                g.action_OnDestroy += () => gameMode.ResumeTimeCounting(g);
+            }
+
+            g.AnimateIconPointerHit();
+
+            RectTransform iconRect = g.transform.Find("IconRect") as RectTransform;
+            iconRect.gameObject.SetActive(true);
+            g.hollowOutMask.isTargetRectCanThrough = false;
+            g.hollowOutMask.SetTarget(iconRect);
+
+            Transform centerPoint = TargetBody.ins.transform.Find("CenterPoint");
+            Transform sidePoint = TargetBody.ins.transform.Find("SidePoint");
+
+            float countDown = 5;
+            g.action_Update += () => {
+                Vector3 centerPos = RectTransformUtility.WorldToScreenPoint(Camera.main, centerPoint.position);
+                Vector3 sidePos = RectTransformUtility.WorldToScreenPoint(Camera.main, sidePoint.position);
+                float sizeLen = Mathf.Abs(centerPos.x - sidePos.x) * 2;
+                iconRect.position = centerPos;
+                iconRect.sizeDelta = JC.Unity.UI.RectTransformUtils.ScreenV3ToCanvasV3(Vector3.one * sizeLen, iconRect); 
+                g.hollowOutMask.RefreshViewImmediate();
+                countDown -= Time.deltaTime;
+                if (countDown <= 0) {
+                    g.clickedWillPlayAudioBtn = false;
+                    g.OnClick_ToNext();
+                }
+            };
+        };
+        configs.Add(config.key, config);
+
+
         config = new NewUserGuiderConfig();
         config = new NewUserGuiderConfig();
         config.key = "教程结束";
         config.key = "教程结束";
         config.hitActive = false;
         config.hitActive = false;
@@ -659,6 +700,7 @@ public class NewUserGuiderManager : MonoBehaviour
         "限时游戏-选择距离",
         "限时游戏-选择距离",
         "视角归位-触发",
         "视角归位-触发",
         // "视角归位-瞄准",
         // "视角归位-瞄准",
+        "准心高亮",
         "教程结束",
         "教程结束",
     });
     });