fix:确保main场景单独可以运行

hebing
zc 2023-10-07 22:00:08 +08:00
parent e300dfb9a3
commit afd7983467
1 changed files with 9 additions and 3 deletions

View File

@ -49,8 +49,13 @@ namespace UnityTest.ZXL
private async ETTask DialogueAsync() // private async ETTask DialogueAsync() //
{ {
var uiBg = GameObject.Find("ZXL").GetComponent<UI_BG>(); var go = GameObject.Find("ZXL");
uiBg.ShowBG(); UI_BG uiBg = null;
if (go)
{
uiBg = go.GetComponent<UI_BG>();
uiBg.ShowBG();
}
var showUI = UIManager.Instance().ShowUI(UIType.Dialogue); var showUI = UIManager.Instance().ShowUI(UIType.Dialogue);
var dialogueUI = showUI as DialogueUI; var dialogueUI = showUI as DialogueUI;
@ -62,7 +67,8 @@ namespace UnityTest.ZXL
EventManager.Instance.FireNow(this, new ProcessOverEventArgs(processType)); EventManager.Instance.FireNow(this, new ProcessOverEventArgs(processType));
UIManager.Instance().HideUI(UIType.Dialogue); UIManager.Instance().HideUI(UIType.Dialogue);
uiBg.HideBG(); if (go)
uiBg.HideBG();
} }
[Button] [Button]