Esempio n. 1
0
    IEnumerator EndlessEyeOpen()
    {
        //Fades out the black panel
        yield return(new WaitForSeconds(4f));

        Image panel = EyeClosePanel.GetComponent <Image>();

        float alpha = 0;

        while (alpha < 1)
        {
            alpha      += Time.deltaTime * 0.3f;
            panel.color = Color.Lerp(Color.black, Color.clear, alpha);
            yield return(0);
        }

        EyeClosePanel.SetActive(false);

        //Creates a new narration trigger at stanley's location, which begins the panic sequence
        GameObject stanley    = GameObject.FindWithTag("Player");
        GameObject newTrigger = Instantiate(FinalNarrationTrigger, stanley.transform.position, Quaternion.identity);

        NarrationTrigger newTrigScript = newTrigger.GetComponent <NarrationTrigger>();

        //Assign the new trigger's variables for it
        newTrigScript.EyeClosePanel  = EyeClosePanel;
        newTrigScript.MainNarration  = MainNarration;
        newTrigScript.Panel          = Panel;
        newTrigScript.PanelDisappear = PanelDisappear;
        newTrigScript.TextDisappear  = TextDisappear;
    }
Esempio n. 2
0
    IEnumerator EndlessPanicBlack()
    {
        //Stops music, waits, then blacks out screen
        audioSystem.MusicAudio.Stop();
        yield return(new WaitForSeconds(2f));

        Image panel = EyeClosePanel.GetComponent <Image>();

        panel.color = Color.black;

        //reloads the scene to start again
        yield return(new WaitForSeconds(5f));

        SceneManager.LoadScene(SceneManager.GetActiveScene().name);
    }
Esempio n. 3
0
    IEnumerator EndlessEyeClose()
    {
        //Makes a black UI panel fade in to black out screen
        EyeClosePanel.SetActive(true);
        Image panel = EyeClosePanel.GetComponent <Image>();

        float alpha = 0;

        while (alpha < 1)
        {
            alpha      += Time.deltaTime * 0.4f;
            panel.color = Color.Lerp(Color.clear, Color.black, alpha);
            yield return(0);
        }
    }
Esempio n. 4
0
    IEnumerator EndlessPanic()
    {
        yield return(new WaitForSeconds(2f));

        audioSystem.MusicAudio.clip = PanicMusic;
        audioSystem.MusicAudio.Play();

        EyeClosePanel.SetActive(true);
        Image panel = EyeClosePanel.GetComponent <Image>();

        //Slowly turns screen tint red
        float alpha = 0;

        while (alpha < 0.6f)
        {
            alpha      += Time.deltaTime * 0.13f;
            panel.color = Color.Lerp(Color.clear, Color.red, alpha);
            yield return(0);
        }
    }