Example #1
0
        public void ShowPanel(string uname, UIParamInfo info)
        {
            if (string.IsNullOrEmpty(uname))
            {
                return;
            }
            IZUIPanel panel = null;

            for (int i = 0; i < panels.Count; i++)
            {
                if (panels[i].definition == uname)
                {
                    panel = panels[i];
                    break;
                }
            }
            if (panel == null)
            {
                panel = CreatePanel(uname, panelParent);
                ActivePanel(panel, info);
            }
            else
            {
                if (panel.isOpen)
                {
                    RepeatOpenPanel(panel, info);
                }
                else
                {
                    ActivePanel(panel, info);
                }
            }
        }
Example #2
0
        private void UpdateCurrentPanel()
        {
            IZUIPanel panel = null;

            for (int i = 0; i < panels.Count; i++)
            {
                IZUIPanel tmp = panels[i];
                if (tmp.isOpen && panel == null)
                {
                    panel = tmp;
                }
                else if (tmp.isOpen && tmp.depth > panel.depth)
                {
                    panel = tmp;
                }
            }
            if (panel != null)
            {
                UpdateHistory();
                _currentPanel = panel as ZUIPanel;
                current       = _currentPanel.name;
            }
            else
            {
                current       = "";
                _currentPanel = null;
            }
        }
Example #3
0
 private void ClosePanel(IZUIPanel panel)
 {
     if (panel == null)
     {
         return;
     }
     //if (_currentPanel == (ZUIPanel)panel)
     //    _currentPanel = null;
     panel.Close(mTransform);
 }
Example #4
0
 private void ActivePanel(IZUIPanel panel, UIParamInfo param)
 {
     if (panel == null)
     {
         return;
     }
     UpdateHistory();
     panel.WakenUp(panelParent);
     _currentPanel = panel as ZUIPanel;
     current       = _currentPanel.name;
     StartCoroutine(OpenInspector(_currentPanel, param));
 }
Example #5
0
        /// <summary>
        /// 重复打开
        /// </summary>
        /// <param name="panel"></param>
        /// <param name="param"></param>
        public void RepeatOpenPanel(IZUIPanel panel, UIParamInfo param)
        {
            if (panel == null)
            {
                return;
            }
            UpdateHistory();
            panel.Open(panelParent, param);
            _currentPanel = panel as ZUIPanel;
            current       = _currentPanel.name;

            ZLog.Warning("panel name = " + current + " is opened!!!");
        }
Example #6
0
        public static int GetWakendPanelCount()
        {
            if (Instance == null)
            {
                Debug.LogError("panel controller is not find!!!");
            }
            int num = 0;

            for (int i = 0; i < Instance.panels.Count; i++)
            {
                IZUIPanel panel = Instance.panels[i];
                if (panel != null && panel.isOpen)
                {
                    num++;
                }
            }

            return(num);
        }
Example #7
0
        public void ShowBackPanel()
        {
            if (_currentPanel != null)
            {
                ClosePanel(_currentPanel);
            }
            string uname = parent;

            if (string.IsNullOrEmpty(uname))
            {
                return;
            }
            history.RemoveAt(history.Count - 1);
            IZUIPanel panel = null;

            for (int i = 0; i < panels.Count; i++)
            {
                if (panels[i].definition == uname)
                {
                    panel = panels[i];
                    break;
                }
            }
            if (panel != null)
            {
                ZUIPanel tmp = panel as ZUIPanel;
                if (panel.isOpen)
                {
                    panel.Open(tmp.Info);
                }
                else
                {
                    panel.WakenUp(panelParent);
                    StartCoroutine(OpenInspector(tmp, tmp.Info));
                }
                _currentPanel = tmp;
                current       = _currentPanel.name;
                ZLog.Warning("ShowBackPanel....." + current);
            }
        }