|  |  |  | 
|---|
|  |  |  | protected override void OnPreOpen() | 
|---|
|  |  |  | { | 
|---|
|  |  |  | m_ClickTarget = null; | 
|---|
|  |  |  | tryGuideCount = 0; | 
|---|
|  |  |  | //关闭其他可能在主界面显示的窗口等 | 
|---|
|  |  |  | UIManager.Instance.CloseWindow<ChatWin>(); | 
|---|
|  |  |  | NewBieCenter.Instance.guideStepChangeEvent += OnStepChange; | 
|---|
|  |  |  | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | var type = stepConfig.guideType; | 
|---|
|  |  |  | if (type == GuideType.NewBie && stepConfig.clickCompleteNoMask) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | { | 
|---|
|  |  |  | m_NewBieMask.SetActive(false); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | 
|---|
|  |  |  | m_GuideTalkRect.SetActive(false); | 
|---|
|  |  |  | DisplayGuide(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int tryGuideCount = 0; | 
|---|
|  |  |  | //界面加载慢还未显示的情况 多检测两次 如果还找不到则警告提示 | 
|---|
|  |  |  | async UniTask DelayDisplay() | 
|---|
|  |  |  | { | 
|---|
|  |  |  | await UniTask.Delay((tryGuideCount + 1) * 100); | 
|---|
|  |  |  | tryGuideCount++; | 
|---|
|  |  |  | Display(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | if (m_ClickTarget == null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Debug.LogError("引导 m_ClickTarget == null; step = " + NewBieCenter.Instance.guideStep); | 
|---|
|  |  |  | ReportStepOver(); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | var btn = m_ClickTarget.GetComponent<Button>(); | 
|---|
|  |  |  | ReportStepOver(); | 
|---|