//private void Update() //{ // if(_showingScreen && InputManager.Instance.XButtonDown()) // HideCurrentScreen(); //} public void ShowScreen(string screenName) { // pause - to do after pause refactor if (_showingScreen) { HideCurrentScreen(); } CanvasGroup screenToShow = FindScreen(screenName); UiUtils.FadeIn(this, screenToShow, fadeDurations); _currentScreen = screenToShow; StartCoroutine(ShowScreenAfterFade(true, fadeDurations)); }
public void ShowScreenWithTimeout(string screenName, float duration) { if (_showingScreen) { HideCurrentScreen(); } CanvasGroup screenToShow = FindScreen(screenName); UiUtils.FadeIn(this, screenToShow, fadeDurations); _currentScreen = screenToShow; StartCoroutine(ShowScreenAfterFade(true, fadeDurations)); StartCoroutine(HideScreenWithDelay(screenName, duration)); }