diff --git a/Assets/00.StaryEvo/Runtime/Tool/PanelSystem/Manager/PanelSystem.cs b/Assets/00.StaryEvo/Runtime/Tool/PanelSystem/Manager/PanelSystem.cs index 007f789..8f5fd69 100644 --- a/Assets/00.StaryEvo/Runtime/Tool/PanelSystem/Manager/PanelSystem.cs +++ b/Assets/00.StaryEvo/Runtime/Tool/PanelSystem/Manager/PanelSystem.cs @@ -139,8 +139,9 @@ namespace Stary.Evo.UIFarme nextPanel = new T(); nextPanel.UIName = panelName; await nextPanel.InitializeAsync(this); - if (!string.IsNullOrEmpty(nextPanel.UIPath)) - nextPanel.SetPanelParent(GameObject.Find(nextPanel.UIPath).transform); + GameObject parentGo = GameObject.Find(nextPanel.UIPath); + if (!string.IsNullOrEmpty(nextPanel.UIPath) && parentGo) + nextPanel.SetPanelParent(parentGo.transform); GameObject panelGo = await nextPanel.CreatePanel(panelName, packageName); ///生成面板后,进行初始化操作 await nextPanel.InitializeAsync(panelGo); @@ -186,8 +187,9 @@ namespace Stary.Evo.UIFarme nextPanel = new T(); nextPanel.UIName = panelName; await nextPanel.InitializeAsync(this); - if (!string.IsNullOrEmpty(nextPanel.UIPath)) - nextPanel.SetPanelParent(GameObject.Find(nextPanel.UIPath).transform); + GameObject parentGo = GameObject.Find(nextPanel.UIPath); + if (!string.IsNullOrEmpty(nextPanel.UIPath) && parentGo) + nextPanel.SetPanelParent(parentGo.transform); GameObject panelGo = await nextPanel.CreatePanel(panelName, packageName); ///生成面板后,进行初始化操作 await nextPanel.InitializeAsync(panelGo); diff --git a/Assets/00.StaryEvo/Runtime/Tool/PanelSystem/Manager/SpriteRendererSystem.cs b/Assets/00.StaryEvo/Runtime/Tool/PanelSystem/Manager/SpriteRendererSystem.cs index 1c217d0..2b7af48 100644 --- a/Assets/00.StaryEvo/Runtime/Tool/PanelSystem/Manager/SpriteRendererSystem.cs +++ b/Assets/00.StaryEvo/Runtime/Tool/PanelSystem/Manager/SpriteRendererSystem.cs @@ -136,8 +136,9 @@ namespace Stary.Evo.UIFarme { nextPanel = new T(); await nextPanel.InitializeAsync(this); - if (!string.IsNullOrEmpty(nextPanel.UIPath)) - nextPanel.SetPanelParent(GameObject.Find(nextPanel.UIPath).transform); + GameObject parentGo = GameObject.Find(nextPanel.UIPath); + if (!string.IsNullOrEmpty(nextPanel.UIPath) && parentGo) + nextPanel.SetPanelParent(parentGo.transform); nextPanel.TweenType = tweenType; GameObject panelGo = await nextPanel.CreatePanel(packageName, nextPanel.UIName); ///生成面板后,进行初始化操作 @@ -183,8 +184,9 @@ namespace Stary.Evo.UIFarme { nextPanel = new T(); await nextPanel.InitializeAsync(this); - if (!string.IsNullOrEmpty(nextPanel.UIPath)) - nextPanel.SetPanelParent(GameObject.Find(nextPanel.UIPath).transform); + GameObject parentGo = GameObject.Find(nextPanel.UIPath); + if (!string.IsNullOrEmpty(nextPanel.UIPath) && parentGo) + nextPanel.SetPanelParent(parentGo.transform); GameObject panelGo = await nextPanel.CreatePanel(packageName, nextPanel.UIName); ///生成面板后,进行初始化操作 await nextPanel.InitializeAsync(panelGo); diff --git a/Assets/00.StaryEvo/package.json b/Assets/00.StaryEvo/package.json index 058d7dc..97c7509 100644 --- a/Assets/00.StaryEvo/package.json +++ b/Assets/00.StaryEvo/package.json @@ -1,6 +1,6 @@ { "name": "com.staryevo.main", - "version": "2.1.20", + "version": "2.2.0", "displayName": "00.StaryEvo", "description": "This is an Framework package(后台服务器版本,端口9527)", "unity": "2021.3",