From b68f7b60504a5030b89375170f797a788a5b6ec8 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 23 十月 2025 14:54:04 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts

---
 Main/System/NewBieGuidance/NewBieWin.cs |   33 ++++++++++++++++++++++++++++-----
 1 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/Main/System/NewBieGuidance/NewBieWin.cs b/Main/System/NewBieGuidance/NewBieWin.cs
index f95d6ab..f94f6ea 100644
--- a/Main/System/NewBieGuidance/NewBieWin.cs
+++ b/Main/System/NewBieGuidance/NewBieWin.cs
@@ -58,6 +58,7 @@
     protected override void OnPreOpen()
     {
         m_ClickTarget = null;
+        tryGuideCount = 0;
         //鍏抽棴鍏朵粬鍙兘鍦ㄤ富鐣岄潰鏄剧ず鐨勭獥鍙g瓑
         UIManager.Instance.CloseWindow<ChatWin>();
         NewBieCenter.Instance.guideStepChangeEvent += OnStepChange;
@@ -105,13 +106,24 @@
             if (m_ClickTarget != null)
             {
                 m_lastTargetPosition = m_ClickTarget.position;
+                tryGuideCount = 0;
             }
             else
             {
-                #if UNITY_EDITOR
-                if (!string.IsNullOrEmpty(stepConfig.UIElementPath))
-                    Debug.LogError($"寮曞姝ラ{step}鎵句笉鍒扮洰鏍噞stepConfig.UIElementPath}, 鑻ヤ笉闇�瑕佽鍒犻櫎璺緞");
-                #endif
+                if (tryGuideCount > 3)
+                {
+
+#if UNITY_EDITOR
+                    if (!string.IsNullOrEmpty(stepConfig.UIElementPath))
+                        Debug.LogError($"寮曞姝ラ{step}鎵句笉鍒扮洰鏍噞stepConfig.UIElementPath}, 鑻ヤ笉闇�瑕佽鍒犻櫎璺緞");
+#endif
+                    ReportStepOver();
+                    tryGuideCount = 0;
+                    return;
+    
+                }
+                DelayDisplay().Forget();
+                return;
             }
         }
         catch (Exception ex)
@@ -122,7 +134,7 @@
 
         var type = stepConfig.guideType;
         if (type == GuideType.NewBie && stepConfig.clickCompleteNoMask)
-        { 
+        {
             m_NewBieMask.SetActive(false);
         }
         else
@@ -153,6 +165,15 @@
             m_GuideTalkRect.SetActive(false);
             DisplayGuide();
         }
+    }
+
+    int tryGuideCount = 0;
+    //鐣岄潰鍔犺浇鎱㈣繕鏈樉绀虹殑鎯呭喌 澶氭娴嬩袱娆� 濡傛灉杩樻壘涓嶅埌鍒欒鍛婃彁绀�
+    async UniTask DelayDisplay()
+    {
+        await UniTask.Delay((tryGuideCount + 1) * 100);
+        tryGuideCount++;
+        Display();
     }
 
 
@@ -278,6 +299,8 @@
                 if (m_ClickTarget == null)
                 {
                     Debug.LogError("寮曞 m_ClickTarget == null; step = " + NewBieCenter.Instance.guideStep);
+                    ReportStepOver();
+                    return;
                 }
                 var btn = m_ClickTarget.GetComponent<Button>();
                 ReportStepOver();

--
Gitblit v1.8.0