Пример #1
0
 public void CloseAll()
 {
     while (m_stack.Count > 0)
     {
         UIContent content = m_stack.Pop() as UIContent;
         m_views[content.name].gameObject.SetActive(false);
         m_views[content.name].OnClose();
     }
 }
Пример #2
0
        public void Back()
        {
            UIContent content = m_stack.Pop() as UIContent;

            m_views[content.name].gameObject.SetActive(false);
            m_views[content.name].OnClose();

            UIContent peek = m_stack.Peek() as UIContent;

            m_views[peek.name].gameObject.SetActive(true);
        }
Пример #3
0
        public void Show <T>()
        {
            string name = typeof(T).ToString();

            if (GetView <T>().isBottom)
            {
                CloseAll();
            }
            UIContent content = new UIContent(name);

            m_stack.Push(content);
            ShowGameObject(name);
        }
Пример #4
0
        private void ShowGameObject(string name)
        {
            UIContent peek = m_stack.Peek() as UIContent;

            m_views[peek.name].gameObject.SetActive(true);
            m_views[peek.name].OnOpen();
            // hide others
            foreach (UIContent obj in m_stack)
            {
                if (obj != peek)
                {
                    m_views[obj.name].gameObject.SetActive(false);
                    m_views[obj.name].OnClose();
                }
            }
        }