コード例 #1
0
    IEnumerator PlayCutscene()
    {
        panel.gameObject.SetActive(true);

        //print out all text and play sounds if applicable
        for (int i = 0; i < messages.Length; i++)
        {
            messages[i].CrossFadeAlpha(0, 0, true);
            messages[i].gameObject.SetActive(true);
            messages[i].CrossFadeAlpha(1f, 2.5f, true);
            if (sounds[i] != null)
            {
                sounds[i].gameObject.SetActive(true);
            }

            yield return(new WaitForSecondsRealtime(3));
        }

        yield return(new WaitForSecondsRealtime(1.5f));


        //trigger next set of messages, otherwise go to next scene
        if (next != null)
        {
            panel.gameObject.SetActive(false);
            next.enabled = true;
            this.enabled = false;
        }
        else
        {
            SceneSwitcher.Instance().loadScene(nextSceneIndex, 3, 3);
        }
    }
コード例 #2
0
    IEnumerator switchDelay()
    {
        yield return(new WaitForSecondsRealtime(delay));

        SceneSwitcher.Instance().loadScene(targetSceneIndex, fadeOutTime, fadeInTime);
    }