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(); }
private void Show(Type screenType) { UILayer newScreen = availableScreens[screenType]; if (screenStack.Count != 0 && newScreen.hidePrevious) { TakeScreenDown(screenStack.Peek()); } screenStack.Push(newScreen); StartCoroutine(PutScreenUp(newScreen)); }
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)); }
private IEnumerator DelayedDown(UILayer screen, float delay) { yield return(new WaitForSeconds(delay)); TakeScreenDown(screen); }
private IEnumerator DelayedUp(UILayer screen, float delay) { yield return(new WaitForSeconds(delay)); StartCoroutine(PutScreenUp(screen)); }
private void TakeScreenDown(UILayer screen) { screen.gameObject.SetActive(false); screen.OnScreenDown(); }