private IEnumerator LerpCR()
    {
        GetComponent <CameraFollow>().FocusOnPlayer();
        float currentTime = 0f;

        while (currentTime < duration)
        {
            VignetteModel          vignet      = ppp.vignette;
            VignetteModel.Settings newVignette = vignet.settings;

            newVignette.intensity  = Mathf.Lerp(1f, 0f, currentTime / duration);
            newVignette.smoothness = Mathf.Lerp(1f, 0f, currentTime / duration);

            vignet.settings = newVignette;

            GrainModel          grain    = ppp.grain;
            GrainModel.Settings newGrain = grain.settings;

            newGrain.intensity             = Mathf.Lerp(1f, 0f, currentTime / duration);
            newGrain.size                  = Mathf.Lerp(3f, 1f, currentTime / duration);
            newGrain.luminanceContribution = Mathf.Lerp(0f, 1f, currentTime / duration);

            grain.settings = newGrain;

            currentTime += Time.deltaTime;
            yield return(null);
        }
    }
    IEnumerator ShowEndingTrainSceneCoroutine()
    {
        iTween.FadeTo(m_CameraFadePanel, 1f, m_CameraFadeDuration + 3.5f);
        m_PlayerSpeechBubble.SetActive(false);
        yield return(new WaitForSeconds(m_CameraFadeDuration + 4f));

        VignetteModel.Settings vignetteSettings = m_PostProcessingProfile.vignette.settings;
        vignetteSettings.intensity = 0f;
        m_PostProcessingProfile.vignette.settings = vignetteSettings;

        GrainModel grainModel = m_PostProcessingProfile.grain;

        grainModel.enabled = true;

        DepthOfFieldModel dofModel = m_PostProcessingProfile.depthOfField;

        dofModel.enabled = true;

        m_GirlfriendMeetingPanel.SetActive(false);
        m_EndingPanel.SetActive(true);
        m_BGMPlayer.PlayEndingSong();

        iTween.FadeTo(m_CameraFadePanel, 0f, m_CameraFadeDuration + 2f);
        yield return(new WaitForSeconds(m_CameraFadeDuration + 4f));

        //m_CinematicScript.ShowNextButton (MoveToCredits);
        yield return(new WaitForSeconds(3f));

        yield return(ShowCreditsCoroutine());
    }
示例#3
0
    void Awake()
    {
        VignetteModel.Settings vignetteSettings = m_PostProcessProfile.vignette.settings;
        vignetteSettings.intensity             = 0f;
        m_PostProcessProfile.vignette.settings = vignetteSettings;

        GrainModel grainModel = m_PostProcessProfile.grain;

        grainModel.enabled = false;

        DepthOfFieldModel dofModel = m_PostProcessProfile.depthOfField;

        dofModel.enabled = false;

        m_AudioSource = GetComponent <AudioSource> ();
    }
 public GrainCellModel(GrainModel grain)
     : this()
     => State = grain;