コード例 #1
0
        private static void DisplayWindow(UIWindow.Cfg cfg, bool show)
        {
            if (cfg == null || cfg.go == null)
            {
                return;
            }

            cfg.go.SetActive(show);
        }
コード例 #2
0
        public Component FindWindowComponent(UIWindow.Id windowId, System.Type type)
        {
            UIWindow.Cfg cfg = FindWindowCfg(windowId);
            if (cfg == null)
            {
                return(null);
            }

            Component component = cfg.go.transform.GetComponent(type);

            return(component);
        }
コード例 #3
0
        private void AddWindow(UIWindow.Id windowId, bool showPrevWindow)
        {
            UIWindow.Cfg cfg = FindWindowCfg(windowId);
            if (cfg == null)
            {
                return;
            }

            // show or hide previous window
            DisplayCurrentWindow(showPrevWindow);

            m_windowIdList.Add(cfg.id);

            // show current window
            DisplayCurrentWindow(true);
        }
コード例 #4
0
        private void RemoveWindow(UIWindow.Id windowId)
        {
            UIWindow.Cfg cfg = FindWindowCfg(windowId);
            if (cfg == null)
            {
                return;
            }

            int index = FindWindowIndex(windowId);

            if (index == -1)
            {
                return;
            }

            // hide window
            DisplayWindow(cfg, false);

            m_windowIdList.RemoveAt(index);

            // show current window
            DisplayCurrentWindow(true);
        }
コード例 #5
0
 private void DisplayCurrentWindow(bool show)
 {
     UIWindow.Id  windowId = GetCurrentWindowId();
     UIWindow.Cfg cfg      = FindWindowCfg(windowId);
     DisplayWindow(cfg, show);
 }
コード例 #6
0
 public UIWindow.Cfg FindWindowCfg(UIWindow.Id windowId)
 {
     UIWindow.Cfg cfg = null;
     m_windowCfgs.TryGetValue(windowId, out cfg);
     return(cfg);
 }