Пример #1
0
    private IEnumerator Tutorial()
    {
        yield return(darkener.DelayedFadeOut(dur: 1));

        instructionText.text = "Use the mouse to look around";
        yield return(new WaitForSeconds(0.5f));

        yield return(instructionTextFadeable.FadeIn());

        yield return(new WaitForSeconds(2f));

        while (!mouseMoved)
        {
            yield return(new WaitForSeconds(0.25f));
        }
        yield return(instructionTextFadeable.FadeOut());

        instructionText.text = "Use WASD to move";
        yield return(new WaitForSeconds(0.25f));

        yield return(instructionTextFadeable.FadeIn());

        yield return(new WaitForSeconds(2f));

        while (!characterMoved)
        {
            yield return(new WaitForSeconds(0.25f));
        }
        yield return(instructionTextFadeable.FadeOut());

        instructionText.text = "Use the spacebar to jump";
        yield return(new WaitForSeconds(0.25f));

        yield return(instructionTextFadeable.FadeIn());

        yield return(new WaitForSeconds(2f));

        while (!characterJumped)
        {
            yield return(new WaitForSeconds(0.25f));
        }
        yield return(instructionTextFadeable.FadeOut());

        StopCoroutine(checkForInput);
        StartCoroutine(GameController.instance.SpawnLumpy());
    }
Пример #2
0
    /// <summary>
    /// Shows the notification.
    /// </summary>
    private IEnumerator ShowNotification(string s, float dur)
    {
        text.text = s;
        yield return(fadeable.FadeIn(dur: 0.2f));

        yield return(new WaitForSecondsRealtime(dur));

        yield return(fadeable.FadeOut(dur: 0.2f));
    }
Пример #3
0
    /// <summary>
    /// Fades the screen black and back.
    /// </summary>
    /// <param name="fadeDur">Fade dur.</param>
    /// <param name="delay">Delay.</param>
    public IEnumerator FadeInNOut(float fadeDur, float delay, Func <IEnumerator> f)
    {
        yield return(darkener.FadeIn(dur: fadeDur));

        yield return(f());

        yield return(new WaitForSeconds(delay));

        yield return(darkener.FadeOut(dur: fadeDur));
    }