增加UI关闭

This commit is contained in:
shenjianxing 2024-12-30 16:42:29 +08:00
parent 7f46db91b8
commit 148a02ee99
3 changed files with 17 additions and 1 deletions

View File

@ -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

View File

@ -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) },
};

View File

@ -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();
}
}