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 )); } } } }
public void FadeIn(float duration, Action callback) { StartCoroutine(ReefHelper.FadeNormalized(ReefHelper.FadeType.In, 3f, (x) => { Renderer.material.SetFloat("_Alpha", x); callback?.Invoke(); }, null)); }
public void FadeOut(float duration, Action callback) { StartCoroutine(ReefHelper.FadeNormalized(ReefHelper.FadeType.Out, 3f, (x) => { Renderer.material.SetFloat("_Alpha", x); }, () => { IsActive = false; callback?.Invoke(); })); }
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 }
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(); }
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)); } }
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)); } }
public void FadeIn(float duration) { StartCoroutine(ReefHelper.FadeNormalized(ReefHelper.FadeType.In, duration, (x) => Renderer.material.SetFloat("_Alpha", x), null)); }
public void FadeOut(float duration) { StartCoroutine(ReefHelper.FadeNormalized(ReefHelper.FadeType.Out, duration, (x) => Renderer.material.SetFloat("_Alpha", x), () => IsActive = false)); }