From 148a02ee993336d476b50039fe30d92a075059cb Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 30 Dec 2024 16:42:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0UI=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/QFramework/Toolkits/UIKit/Scripts/UIKit.cs | 11 +++++++++++ Assets/Scripts/Actions/ActionHelper.cs | 1 + Assets/Scripts/Actions/UIShowAction.cs | 6 +++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Assets/QFramework/Toolkits/UIKit/Scripts/UIKit.cs b/Assets/QFramework/Toolkits/UIKit/Scripts/UIKit.cs index 66ae53c3..f7a11b0f 100644 --- a/Assets/QFramework/Toolkits/UIKit/Scripts/UIKit.cs +++ b/Assets/QFramework/Toolkits/UIKit/Scripts/UIKit.cs @@ -308,6 +308,17 @@ UIKit.GetPanel(""UIHomePanel""); return retPanel as T; } + public static UIPanel GetPanel(Type type) + { + var panelSearchKeys = PanelSearchKeys.Allocate(); + panelSearchKeys.PanelType = type; + + var retPanel = UIManager.Instance.GetUI(panelSearchKeys); + + panelSearchKeys.Recycle2Cache(); + + return retPanel; + } #region 给脚本层用的 api diff --git a/Assets/Scripts/Actions/ActionHelper.cs b/Assets/Scripts/Actions/ActionHelper.cs index d045490c..f5fe5cc9 100644 --- a/Assets/Scripts/Actions/ActionHelper.cs +++ b/Assets/Scripts/Actions/ActionHelper.cs @@ -16,6 +16,7 @@ public class ActionHelper { "UIBtns", typeof(QFramework.Example.UIBtns) }, { "UITools", typeof(QFramework.Example.UITools) }, { "UIHint", typeof(QFramework.Example.UIHint) }, + { "UITextTip", typeof(QFramework.Example.UITextTip) }, { "UICameraSwitch", typeof(QFramework.Example.UICameraSwitch) }, }; diff --git a/Assets/Scripts/Actions/UIShowAction.cs b/Assets/Scripts/Actions/UIShowAction.cs index 0555a46c..d05108e1 100644 --- a/Assets/Scripts/Actions/UIShowAction.cs +++ b/Assets/Scripts/Actions/UIShowAction.cs @@ -53,7 +53,11 @@ public class UIShowAction : IAction } else { - UIKit.HidePanel(ActionHelper.typeDict[uiName]); + if (UIKit.GetPanel(ActionHelper.typeDict[uiName]) != null) + { + UIKit.HidePanel(ActionHelper.typeDict[uiName]); + } + this.Finish(); } }