/// <summary>
        /// Loads a screen based on it's screen id.
        /// </summary>
        /// <param name="screenId">Unique identifier for a screen.</param>
        private UIBaseScreen LoadScreen(UIScreenId screenId)
        {
            GameObject screenPrefab = GetPrefabFromScreenId(screenId);

            if (screenPrefab != null)
            {
                // Instantiate the screen in the canvas.
                GameObject instantiatedPrefab = GameObject.Instantiate(screenPrefab, mCanvas.transform);

                if (instantiatedPrefab != null)
                {
                    UIBaseScreen screen = instantiatedPrefab.GetComponent <UIBaseScreen>();

                    if (screen != null)
                    {
                        // Call set defaults and assign the current screen.
                        screen.Initialize();

                        return(screen);
                    }
                }
            }

            return(null);
        }
        /// <summary>
        /// Transition Work Enumerator.
        /// Carries out the screen loading process and locks the system until a screen has been loaded.
        /// </summary>
        /// <param name="screenId"></param>
        /// <returns></returns>
        private IEnumerator DoScreenTransition(UIScreenId screenId)
        {
            // if this is a new screen... (it should always be.)
            if (screenId != UIScreenId.None)
            {
                mInputLock = true;
                bool canNavigateBackwards = false;

                if (mCurrentScreen != null)
                {
                    canNavigateBackwards = mCurrentScreen.CanNavigateBack;
                    yield return(StartCoroutine(mCurrentScreen.DoScreenAnimation(UIScreenAnimState.Outro)));

                    UnloadCurrentScreen();
                }

                mPrefabLoadingLock = true;
                UIBaseScreen loadedScreen = LoadScreen(screenId);

                if (loadedScreen != null)
                {
                    while (mPrefabLoadingLock)
                    {
                        yield return(null);
                    }

                    // If the current screen doesn't support back navigation, remove it from the stack.
                    if (!canNavigateBackwards && mScreenStack.Count > 0)
                    {
                        mScreenStack.Pop();
                    }

                    mCurrentScreen = loadedScreen;

                    // Back transitions can't add the screen twice.
                    if (mScreenStack.Count == 0 || (mScreenStack.Count > 0 && screenId != mScreenStack.Peek()))
                    {
                        // Push the new screen onto the stack.
                        mScreenStack.Push(screenId);
                    }

                    // Fire the 3d background animation.
                    UIManager.Instance.Transition3dCamera(mCurrentScreen.BackgroundState);

                    yield return(StartCoroutine(mCurrentScreen.DoScreenAnimation(UIScreenAnimState.Intro)));

                    mCurrentScreen.SetPrompts();
                }
                mInputLock = false;
            }
        }