示例#1
0
        private IEnumerator PutScreenUp(UILayer screen)
        {
            screen.gameObject.SetActive(true);
            screen.OnScreenUp();
            yield return(null);            //Wait a frame so when screens run OnScreenUpAndReady they can actually use coroutines

            screen.OnScreenUpAndReady();
        }
示例#2
0
        private void Show(Type screenType)
        {
            UILayer newScreen = availableScreens[screenType];

            if (screenStack.Count != 0 && newScreen.hidePrevious)
            {
                TakeScreenDown(screenStack.Peek());
            }
            screenStack.Push(newScreen);
            StartCoroutine(PutScreenUp(newScreen));
        }
示例#3
0
        private void DelayedShow(Type screenType, float delay)
        {
            UILayer newScreen = availableScreens[screenType];

            //Check if the stack is not empty
            if (screenStack.Count != 0 && newScreen.hidePrevious)
            {
                TakeScreenDown(screenStack.Peek());
            }
            screenStack.Push(newScreen);
            StartCoroutine(DelayedUp(newScreen, delay));
        }
示例#4
0
        private IEnumerator DelayedDown(UILayer screen, float delay)
        {
            yield return(new WaitForSeconds(delay));

            TakeScreenDown(screen);
        }
示例#5
0
        private IEnumerator DelayedUp(UILayer screen, float delay)
        {
            yield return(new WaitForSeconds(delay));

            StartCoroutine(PutScreenUp(screen));
        }
示例#6
0
 private void TakeScreenDown(UILayer screen)
 {
     screen.gameObject.SetActive(false);
     screen.OnScreenDown();
 }