From afd7983467143c2543a99e69c8dcb001b4e1aada Mon Sep 17 00:00:00 2001 From: zc <1062808664@qq.com> Date: Sat, 7 Oct 2023 22:00:08 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E7=A1=AE=E4=BF=9Dmain=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E5=8D=95=E7=8B=AC=E5=8F=AF=E4=BB=A5=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UnityTest/ZXL/Scripts/Process/SecondProcess.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Assets/UnityTest/ZXL/Scripts/Process/SecondProcess.cs b/Assets/UnityTest/ZXL/Scripts/Process/SecondProcess.cs index 10a87789..be60e75f 100644 --- a/Assets/UnityTest/ZXL/Scripts/Process/SecondProcess.cs +++ b/Assets/UnityTest/ZXL/Scripts/Process/SecondProcess.cs @@ -49,8 +49,13 @@ namespace UnityTest.ZXL private async ETTask DialogueAsync() // { - var uiBg = GameObject.Find("ZXL").GetComponent(); - uiBg.ShowBG(); + var go = GameObject.Find("ZXL"); + UI_BG uiBg = null; + if (go) + { + uiBg = go.GetComponent(); + uiBg.ShowBG(); + } var showUI = UIManager.Instance().ShowUI(UIType.Dialogue); var dialogueUI = showUI as DialogueUI; @@ -62,7 +67,8 @@ namespace UnityTest.ZXL EventManager.Instance.FireNow(this, new ProcessOverEventArgs(processType)); UIManager.Instance().HideUI(UIType.Dialogue); - uiBg.HideBG(); + if (go) + uiBg.HideBG(); } [Button]