Пример #1
0
        public void Pop()
        {
            if (_contextStack.Count != 0)
            {
                BaseContext curContext = _contextStack.Peek();
                _contextStack.Pop();

                BaseView curView = UIManager.Instance.GetSingleUI(curContext.ViewType).GetComponent <BaseView>();
                curView.OnExit(curContext);
            }

            if (_contextStack.Count != 0)
            {
                BaseContext lastContext = _contextStack.Peek();
                BaseView    curView     = UIManager.Instance.GetSingleUI(lastContext.ViewType).GetComponent <BaseView>();
                curView.OnResume(lastContext);
            }
        }
Пример #2
0
        public void LineStart()
        {
            if (_contextStack.Count == 0)
            {
                return;
            }
            BaseView temp;

            foreach (BaseContext item in _contextStack)
            {
                temp = UIManager.Instance.GetSingleUI(item.ViewType).GetComponent <BaseView> ();
                temp.OnEnter(item);
                temp.OnPause(item);
            }

            BaseContext lastContext = _contextStack.Peek();
            BaseView    curView     = UIManager.Instance.GetSingleUI(lastContext.ViewType).GetComponent <BaseView>();

            curView.OnResume(lastContext);
        }
Пример #3
0
        public void Pop()
        {
            UIType curType  = UIType.None;
            UIType nextType = UIType.None;

            if (_contextStack.Count != 0)
            {
                BaseContext curContext = _contextStack.Peek();
                _contextStack.Pop();
                BaseView curView = UIManager.Instance.GetSingleUI(curContext.ViewType).GetComponent <BaseView>();
                curView.OnExit(curContext);
            }

            if (_contextStack.Count != 0)
            {
                BaseContext lastContext = _contextStack.Peek();
                curType     = lastContext.ViewType;
                _curContext = lastContext;
                BaseView curView = UIManager.Instance.GetSingleUI(lastContext.ViewType).GetComponent <BaseView>();
                curView.transform.SetAsLastSibling();
                if (!curView.hasEnter)
                {
                    curView.OnEnter(lastContext);
                    curView.OnPause(lastContext);
                }
                curView.OnResume(lastContext);
                if (curView.closeOtherUI)
                {
                    UIManager.Instance.CloseAllUI();
                }
                if (!UIManager.Instance.activeView.Contains(curView))
                {
                    UIManager.Instance.activeView.Add(curView);
                }
            }
            DisableInstant();
            UIManager.Instance.commonUIManager.Refresh(curType, nextType);
        }