Example #1
0
    private IEnumerator _FadeInOut()
    {
        BlackScreenIn.SetActive(true);
        yield return(new WaitForSeconds(1.3f));

        BlackScreenOut.SetActive(true);
        BlackScreenIn.SetActive(false);
        yield return(new WaitForSeconds(1f));

        BlackScreenOut.SetActive(false);
    }
Example #2
0
    private IEnumerator StartGameOverAnim()
    {
        yield return(new WaitForSeconds(1));

        // GameOverSound.Play();
        audiosLose[Random.Range(0, audiosLose.Length)].Play();

        GameOver.SetActive(false);
        GameOver.SetActive(true);
        GameOver.transform.position = Camera.main.transform.position + new Vector3(-13.34f, -25.9f, 20);
        BlackScreenIn.SetActive(false);
        BlackScreenOut.SetActive(false);
        yield return(null);
    }
Example #3
0
    public IEnumerator ShowVideo(int CurrentLevel, bool preview = false)
    {
        print(CapitulosManager.MaxLevel + "   " + (CurrentLevel));
        Skiped = false;
        bool secondTime = false;

        IsPreview = preview;
        if (!IsPreview)
        {
            GM.UnlockNew(CurrentLevel + 1);
            bt.gameObject.SetActive(false);
        }
        if (IsPreview || CapitulosManager.MaxLevel > CurrentLevel)
        {
            secondTime = true;
            StartCoroutine(ShowSkipButtonGradually(3.5f));
        }

        BlackScreenOut.SetActive(false);
        BlackScreenIn.SetActive(true);

        // CurrentLevel-= 2;

        CurrentLevel_ = CurrentLevel;
        if (CurrentLevel_ == 0 || IsPreview)
        {
            soundManager.FadeInMenuSound();
        }
        else
        {
            soundManager.FadeInGameplaySound();
        }

        yield return(new WaitForSeconds(1.4f));

        camPrincipal.enabled  = false;
        camSecundaria.enabled = true;
        videos[CurrentLevel].gameObject.SetActive(true);
        StartCoroutine(ShowVideoGradually(videos[CurrentLevel], 1));
        float lengthy = (float)videos[CurrentLevel].clip.length;

        if (!secondTime)
        {
            StartCoroutine(ShowSkipButtonGradually(10));
        }
        yield return(new WaitForSeconds(lengthy + 1));

        Skip();
    }
Example #4
0
    private IEnumerator FinishGameOverAnim(bool goMenu)
    {
        BlackScreenIn.SetActive(true);
        yield return(new WaitForSeconds(1f));

        if (goMenu)
        {
            CameraMovementScript.SetPosition(0);
        }
        BlackScreenOut.SetActive(true);
        BlackScreenIn.SetActive(false);
        GameOver.SetActive(false);
        yield return(new WaitForSeconds(1f));

        BlackScreenOut.SetActive(false);
        IsActive = false;
    }
Example #5
0
    private IEnumerator HideVideoGradually(VideoPlayer video, float time)
    {
        StartCoroutine(HideSkipButtonGradually(0));
        float auxTime = 0;

        float volumeSFX = ApplicationController.GetVolumeSFX();

        while (auxTime <= time)
        {
            auxTime += Time.deltaTime;
            video.targetCameraAlpha = 1 - auxTime / time;
            video.SetDirectAudioVolume(0, volumeSFX - auxTime / time * volumeSFX);
            yield return(null);
        }
        videos[CurrentLevel_].gameObject.SetActive(false);
        camPrincipal.enabled  = true;
        camSecundaria.enabled = false;
        BlackScreenIn.SetActive(false);
        BlackScreenOut.SetActive(true);
        bt.gameObject.SetActive(false);
        yield return(new WaitForSeconds(1.6f));

        if (!IsPreview)
        {
            if (CurrentLevel_ == 0)
            {
                camMove.SetDestiny(2);
                soundManager.SwitGamePlayAndMenu();
            }
            else
            {
                soundManager.FadeOutGameplaySound();
            }
        }

        Skiped          = true;
        GM.ShowingVideo = false;
        StopCoroutine(CurrentCoroutine);
        CurrentCoroutine = null;
    }