예제 #1
0
 public void PopPanel(BaseUI panelType)
 {
     if (panelList == null || panelList.Count <= 0)
     {
         return;
     }
     panelType.OnExit();
     panelList.Remove(panelType);
 }
예제 #2
0
        public void PopPanel(UIPanelType panelType, bool isDestory = false)
        {
            if (panelList == null || panelList.Count <= 0)
            {
                return;
            }

            BaseUI topPanel = panelDict[panelType];

            topPanel.OnExit();
            panelList.Remove(topPanel);
            if (isDestory)
            {
                GameObject.Destroy(topPanel.gameObject);
                panelDict.Remove(panelType);
            }
        }
예제 #3
0
        public BaseUI PushPanel(UIPanelType panelType, bool isExit = false)
        {
            BaseUI topPanel = null;

            if (panelList.Count > 0 && isExit)
            {
                topPanel = panelList[panelList.Count - 1];
                topPanel.OnExit();
            }
            BaseUI panel = GetPanel(panelType);

            if (!panelList.Contains(panel))
            {
                panelList.Add(panel);
                panel.OnEnter();
            }
            return(panel);
        }