using System; using AlicizaX.Runtime; namespace AlicizaX.UI.Runtime { public enum EPanelState { /// /// 没创建 /// None, /// /// /已经打开 /// Show, /// /// 缓存 /// Cache } public class PanelInfo { public UIWindow UIBasePanel { get; private set; } public bool Visible => UIBasePanel?.Visible ?? false; public string Name { get; internal set; } public EUIResLoadType UIResLoadType { get; internal set; } public UILayer UIPanelLayer { get; internal set; } public bool FullScreen { get; internal set; } public string Res { get; internal set; } public int DelayedClose { get; internal set; } public Type UIClsType { get; internal set; } public EPanelState PanelState = EPanelState.None; internal void Reset(UIBase uiBase) { switch (uiBase) { case null: UIBasePanel = null; break; case UIWindow uiWindow: UIBasePanel = uiWindow; break; default: Log.Error($"当前UI 不是Panel 请检查 "); break; } } internal void SetPanelState(EPanelState state) { PanelState = state; } public static PanelInfo Create(string name, EUIResLoadType resLoadType, UILayer layer, bool fullScreen, string res, int delayedClose, Type type) { PanelInfo panelInfo = new PanelInfo(); panelInfo.Name = name; panelInfo.UIResLoadType = resLoadType; panelInfo.UIPanelLayer = layer; panelInfo.FullScreen = fullScreen; panelInfo.Res = res; panelInfo.DelayedClose = delayedClose; panelInfo.UIClsType = type; return panelInfo; } } }