Пример #1
0
        public FPanel OpenPanel(Type type)
        {
            FPanel panel = GetPanel(type);

            if (null == panel)
            {
                var pinfo     = pinfoByType[type];
                var component = UIPackage.CreateObject(pinfo.package, pinfo.type.Name) as GComponent;
                layers[(int)pinfo.layer].AddChild(component);

                panel = Activator.CreateInstance(type) as FPanel;
                panel.Init(component);
                panels.Add(type, panel);
            }
            panel.Visible = true;
            return(panel);
        }
Пример #2
0
        public void ClosePanel(Type type, bool destroy = false)
        {
            FPanel panel = GetPanel(type);

            if (null != panel)
            {
                if (destroy)
                {
                    panel.Dispose();
                    panels.Remove(type);
                }
                else
                {
                    panel.Visible = false;
                }
            }
        }