Пример #1
0
        IEnumerator DoOpenPrevs()
        {
            mTransitionCount = 0;

            //re-show modals behind
            foreach (UIData prevUId in mModalStack)
            {
                prevUId.ui.gameObject.SetActive(true);
                prevUId.ui.Open();

                TransitionBase trans = prevUId.transition;
                if (trans)
                {
                    mTransitions[mTransitionCount] = trans;
                    mTransitionCount++;
                    StartCoroutine(trans.Open());
                }

                if (prevUId.exclusive)
                {
                    break;
                }
            }

            //wait till everything is done
            for (int i = 0; i < mTransitionCount; i++)
            {
                while (mTransitions[i].state == TransitionBase.State.Open)
                {
                    yield return(null);
                }
            }

            mTransitionCount = 0;
        }
Пример #2
0
            private void GrabUI()
            {
                if (isPrefab)
                {
                    Vector3 p = _ui.transform.localPosition;
                    mUI = (Controller)Object.Instantiate(_ui);
                    mUI.transform.parent        = instantiateTo;
                    mUI.transform.localPosition = p;
                    mUI.transform.localScale    = Vector3.one;
                }
                else
                {
                    mUI = _ui;
                }

                if (mUI)
                {
                    mTransition = mUI.GetComponent <TransitionBase>();
                }
                else
                {
                    Debug.LogWarning("UIController not set.");
                }
            }