Esempio n. 1
0
        public void Push(BaseContext nextContext)
        {
            UIType curType  = nextContext.ViewType;
            UIType nextType = UIType.None;

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

            if (nextView.closeOtherUI)
            {
                UIManager.Instance.CloseAllUI();
            }
            _contextStack.Push(nextContext);
            _curContext = nextContext;
            nextView.transform.SetAsLastSibling();
            nextView.OnEnter(nextContext);
            DisableInstant();
            if (!UIManager.Instance.activeView.Contains(nextView))
            {
                UIManager.Instance.activeView.Add(nextView);
            }
            UIManager.Instance.commonUIManager.Refresh(curType, nextType);
        }
Esempio n. 2
0
        public void Push(BaseContext nextContext)
        {
            if (_contextStack.Count != 0)
            {
                BaseContext curContext = _contextStack.Peek();
                BaseView    curView    = UIManager.Instance.GetSingleUI(curContext.ViewType).GetComponent <BaseView>();
                curView.OnPause(curContext);
            }
            _contextStack.Push(nextContext);
            BaseView nextView = UIManager.Instance.GetSingleUI(nextContext.ViewType).GetComponent <BaseView>();

            nextView.transform.SetAsLastSibling();
            nextView.OnEnter(nextContext);
        }
Esempio n. 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);
        }