From e72c2257651340d8e250f02573c701ada5121d2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=93=AE?= <834207172@qq.com> Date: Tue, 22 Apr 2025 10:03:07 +0800 Subject: [PATCH] =?UTF-8?q?06=20UI=E7=BB=84=E4=BB=B6=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/06.UIFarme/RunTime/Base/BasePanel.cs | 14 ++++++++------ Assets/06.UIFarme/RunTime/Manager/PanelSystem.cs | 2 +- Assets/06.UIFarme/package.json | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Assets/06.UIFarme/RunTime/Base/BasePanel.cs b/Assets/06.UIFarme/RunTime/Base/BasePanel.cs index 3e6eeab..1cd0539 100644 --- a/Assets/06.UIFarme/RunTime/Base/BasePanel.cs +++ b/Assets/06.UIFarme/RunTime/Base/BasePanel.cs @@ -155,12 +155,6 @@ namespace Stary.Evo.UIFarme Debug.LogError($"UnityEvo:parent为空,{panelName}无法创建,进程已中断,请检查!!!!!"); return null; } - - if (!panelParent.GetComponent()) - { - Debug.LogError($"UnityEvo:panelParent上不存在Canvas组件,{panelName}无法创建,进程已中断,请检查!!!!!"); - return null; - } if (this.activePanel != null) { @@ -172,6 +166,14 @@ namespace Stary.Evo.UIFarme activePanel = GameObject.Instantiate(handle.AssetObject as GameObject,panelParent); activePanel.name = this.GetType().Name; + + + if (!activePanel.GetComponent()) + { + Debug.LogError($"UnityEvo:panelParent上不存在Canvas组件,{panelName}无法正常运行,进程已中断,请检查!!!!!"); + return null; + } + return activePanel; } diff --git a/Assets/06.UIFarme/RunTime/Manager/PanelSystem.cs b/Assets/06.UIFarme/RunTime/Manager/PanelSystem.cs index 0cde348..198b97e 100644 --- a/Assets/06.UIFarme/RunTime/Manager/PanelSystem.cs +++ b/Assets/06.UIFarme/RunTime/Manager/PanelSystem.cs @@ -104,7 +104,7 @@ namespace Stary.Evo.UIFarme nextPanel = new T(); nextPanel.Initialize(this); nextPanel.SetPanelParent(parent); - GameObject panelGo = await nextPanel.CreatePanel(panelName); + GameObject panelGo = await nextPanel.CreatePanel($"Prefabs_{panelName}"); ///生成面板后,进行初始化操作 nextPanel.Initialize(panelGo); dicUI.Add(panelName, nextPanel); diff --git a/Assets/06.UIFarme/package.json b/Assets/06.UIFarme/package.json index 880f283..d37f05b 100644 --- a/Assets/06.UIFarme/package.json +++ b/Assets/06.UIFarme/package.json @@ -1,7 +1,7 @@ { "name": "com.staryevo.uifarme", "displayName": "06.UIFarme", - "version": "1.0.3", + "version": "1.0.4", "description": "UI模板框架工具", "unity": "2021.3", "unityRelease": "30f1",