예제 #1
0
    // Update is called once per frame
    void Update()
    {
        // STAR ACTIVE
        if (StarActive == true)
        {
            Timer += Time.deltaTime;
            if (Timer > WaitingTime)
            {
                //Debug.Log(WaitingTime + " second(s) elapsed.");
                StarActive = false;
                PlayerScript.StarPowerUpReset();
                Timer = 0;
            }
        }

        // Rocket Color

        if (StarActive == true)
        {
            rocketAnimator.SetBool("Active", true);
        }
        else
        {
            rocketAnimator.SetBool("Active", false);
        }

        // CHANGE EFFECTS BASED ON IF POWERUP IS ACTIVE

        if (StarActive == false && Vignette.intensity.value != VignetteDefault)
        {
            Vignette.intensity.value = Mathf.Lerp(Vignette.intensity.value, VignetteDefault, 2f * Time.deltaTime); // start value, end value, over time
        }
        if (StarActive == true && Vignette.intensity.value != VignetteActive)
        {
            Vignette.intensity.value = Mathf.Lerp(Vignette.intensity.value, VignetteActive, 1.5f * Time.deltaTime); // start value, end value, over time
        }

        if (StarActive == false && Chromatic.intensity.value != ChromaticDefault)
        {
            Chromatic.intensity.value = Mathf.Lerp(Chromatic.intensity.value, ChromaticDefault, 2f * Time.deltaTime); // start value, end value, over time
        }
        if (StarActive == true && Vignette.intensity.value != VignetteActive)
        {
            Chromatic.intensity.value = Mathf.Lerp(Chromatic.intensity.value, ChromaticActive, 1.5f * Time.deltaTime); // start value, end value, over time
        }
    }