예제 #1
0
파일: HUD.cs 프로젝트: chimpoka/AcidSpace
    IEnumerator StartLevel()
    {
        fading.FadeOut(fadingTime);
        yield return(new WaitForSeconds(fadingTime));

        // fading.FadeIn(fadingTime);

        StartGame();
    }
예제 #2
0
 IEnumerator FadeOutBeforeLevelEnd()
 {
     //fade out when end
     fade.FadeOut();
     while (fade.fadeOutDone == false)
     {
         yield return(new WaitForSeconds(0.05f));
     }
     EventManager.TriggerEvent("Level Ended");
 }
    /*
     * Create lose effect and activates canvas group
     */
    public IEnumerator Restart()
    {
        yield return(StartCoroutine(_writer.WriteNarration("No wonder you were caught in the first place")));

        yield return(new WaitForSeconds(1.5f));

        _sceneFader.FadeOut();
        GetComponent <CanvasGroup>().blocksRaycasts = true;
        _restart.SetActive(true);
    }
    public override void StartInteraction()
    {
        Wait(1, () =>
        {
            StartCoroutine(ZoomOutCamera());
            base.StartInteraction();


            Wait(5, () =>
            {
                SecondDialog.ShowBubble();
                Wait(2f, () =>
                {
                    particles.Play();
                    Wait(0.3f, () => Sister.sprite = Resources.Load("sister", typeof(Sprite)) as Sprite);

                    Wait(4, () => thirdDialog.ShowBubble());

                    Wait(8, () => fading.FadeOut());


                    Wait(10, End); //TODO HACK});
                });
            });
        });
    }
예제 #5
0
    IEnumerator ChangeScene(int scene)
    {
        fading.FadeOut(fadingTime);
        yield return(new WaitForSeconds(fadingTime));

        SceneManager.LoadScene(scene);
    }
예제 #6
0
    IEnumerator delayWait()
    {
        //print("waiting");
        yield return(new WaitForSeconds(displayTime));

        fading.FadeOut();
        yield return(new WaitForSeconds(fading.fadeSpeed + 0.5f));

        Application.LoadLevel("TitleScreen");
    }
예제 #7
0
    public IEnumerator RunGame()
    {
        //print("waiting");
        if (hasSeenTutorial)
        {
            tutorial.gameObject.SetActive(false);
            fading.gameObject.SetActive(true);
            fading.FadeOut();
            yield return(new WaitForSeconds(fading.fadeSpeed));

            //print("load main");
            Application.LoadLevel("Main");
        }
        else
        {
            tutorial.gameObject.SetActive(true);
            tutorial.willReturnToMenu(false);
            hasSeenTutorial = true;
            PlayerPrefs.SetInt("HasSeenTutorial", 1);
        }
    }
    /*
     * Specific function for menu
     * Fades into game
     * Cannot use that of regular scene handler because conflicts in terms of facilities used, e.g. inventory doesn't exist here
     */
    public void ToGame()
    {
        _fader.FadeOut();

        StartCoroutine(WaitToFade());
    }