Ejemplo n.º 1
0
        private void ExitTransition(UITransitionMode mode)
        {
            // Analysis the filter view need to show
            List <UIType> curfilter = new List <UIType>();

            for (int i = blockViewlist.Count - 1; i >= 0; i--)
            {
                curfilter.Add(blockViewlist[i]);

                if (i == (blockViewlist.Count - (int)mode))
                {
                    break;
                }
            }

            //return to filter view
            for (int i = curfilter.Count; i > 0; i--)
            {
                if (curfilter[i - 1] != _viewStack.Peek().uiType)
                {
                    UIManager.Instance.GetUIByType(curfilter[i - 1], (v, p) => { v.OnEnter(); });
                }
            }

            // return to the view that come from
            if (!curfilter.Contains(_lastViewType) && !_lastViewType.Equals(UIType.None))
            {
                UIManager.Instance.GetUIByType(_lastViewType, (v, p) => { v.OnEnter(); });
            }
        }
Ejemplo n.º 2
0
    void Awake()
    {
        _gameManager   = ( GameManager )FindObjectOfType(typeof(GameManager));
        _thisTransform = transform;

        if (uiType.Equals(UIType.GameOver) || uiType.Equals(UIType.GameUI))
        {
            _txtFishsCounter  = ( Text )_thisTransform.FindChild("lblfishs").GetComponent <Text>();
            _txtPlayerCounter = ( Text )_thisTransform.FindChild("lblplayer").GetComponent <Text>();
            _txtTimer         = ( Text )_thisTransform.FindChild("lbltimer").GetComponent <Text>();
            _pnlFishs         = ( Transform )_thisTransform.FindChild("pnlfishs").transform;
        }

        if (uiType.Equals(UIType.GameOver) || uiType.Equals(UIType.GameStart))
        {
            _restartMsg = ( Text )_thisTransform.FindChild("lblrestart").GetComponent <Text>();
        }

        if (uiType.Equals(UIType.GameStart))
        {
            _mainMenu     = _thisTransform.FindChild("MainScreen");
            _instructions = _thisTransform.FindChild("Instructions");
        }

        if (uiType.Equals(UIType.GameOver) || uiType.Equals(UIType.GameUI))
        {
            _gameManager.OnUpdateCounters += updateCounter;
            _gameManager.OnUpdateTimer    += updateTimer;
        }
    }