Esempio n. 1
0
    IEnumerator ColorizerRoutine()
    {
        while (EnableColorizer)
        {
            yield return(new WaitForSeconds(colorizerTime));

            colorizerOn   = !colorizerOn;
            colorizerTime = colorizerOn ? Random.Range(8f, 30f) : Random.Range(30f, 120f);

            if (colorizerOn)
            {
                for (int i = 0; i < NUM_BUFFERS; i++)
                {
                    StartCoroutine(ReefHelper.FadeNormalized(ReefHelper.FadeType.In, 4f,
                                                             (x) => colorizerDamping = x, null
                                                             ));
                }
            }
            else
            {
                for (int i = 0; i < NUM_BUFFERS; i++)
                {
                    StartCoroutine(ReefHelper.FadeNormalized(ReefHelper.FadeType.Out, 4f,
                                                             (x) => colorizerDamping = x, null
                                                             ));
                }
            }
        }
    }
Esempio n. 2
0
 public void FadeIn(float duration, Action callback)
 {
     StartCoroutine(ReefHelper.FadeNormalized(ReefHelper.FadeType.In, 3f,
                                              (x) => {
         Renderer.material.SetFloat("_Alpha", x);
         callback?.Invoke();
     },
                                              null));
 }
Esempio n. 3
0
 public void FadeOut(float duration, Action callback)
 {
     StartCoroutine(ReefHelper.FadeNormalized(ReefHelper.FadeType.Out, 3f,
                                              (x) => { Renderer.material.SetFloat("_Alpha", x); },
                                              () => {
         IsActive = false;
         callback?.Invoke();
     }));
 }
Esempio n. 4
0
 public override void Cancel()
 {
     StartCoroutine(ReefHelper.FadeNormalized(ReefHelper.FadeType.Out, 3f,
                                              (x) => m_titlePlane.PlaneMaterial.SetFloat("_Alpha", x),
                                              () => {
         base.Cancel();
         TitleQueued = false;
     }
                                              ));
     // do cancel until after fade is finished
 }
Esempio n. 5
0
    public override void Renew()
    {
        m_beatInfoManager.SetActive(true);
        if (!TitleQueued)
        {
            m_titlePlane.SetVideoTexture(m_titleTextures[0]);
        }
        StartCoroutine(ReefHelper.FadeNormalized(ReefHelper.FadeType.In, 3f,
                                                 (x) => m_titlePlane.PlaneMaterial.SetFloat("_Alpha", x),
                                                 null));

        // call renew during fade
        base.Renew();
    }
Esempio n. 6
0
 public void DarkenBackground(bool enable)
 {
     if (enable)
     {
         StartCoroutine(ReefHelper.FadeNormalized(ReefHelper.FadeType.In, 2f,
                                                  (x) => brightnessPlane.PlaneMaterial.SetFloat("_Alpha", x * DarknessLevel),
                                                  null));
     }
     else
     {
         StartCoroutine(ReefHelper.FadeNormalized(ReefHelper.FadeType.Out, 2f,
                                                  (x) => brightnessPlane.PlaneMaterial.SetFloat("_Alpha", x * DarknessLevel),
                                                  null));
     }
 }
Esempio n. 7
0
 private void SetActive(bool active)
 {
     if (active)
     {
         StartCoroutine(ReefHelper.FadeNormalized(ReefHelper.FadeType.In, 3f,
                                                  (x) => m_pTextureMixMaterial.SetFloat("_Alpha", x),
                                                  null));
     }
     else
     {
         StartCoroutine(ReefHelper.FadeNormalized(ReefHelper.FadeType.Out, 3f,
                                                  (x) => m_pTextureMixMaterial.SetFloat("_Alpha", x),
                                                  null));
     }
 }
Esempio n. 8
0
 public void FadeIn(float duration)
 {
     StartCoroutine(ReefHelper.FadeNormalized(ReefHelper.FadeType.In, duration,
                                              (x) => Renderer.material.SetFloat("_Alpha", x),
                                              null));
 }
Esempio n. 9
0
 public void FadeOut(float duration)
 {
     StartCoroutine(ReefHelper.FadeNormalized(ReefHelper.FadeType.Out, duration,
                                              (x) => Renderer.material.SetFloat("_Alpha", x),
                                              () => IsActive = false));
 }