Ejemplo n.º 1
0
        private IEnumerator FadingRoutine(float startAlpha, float finishAlpha, float duration)
        {
            var step = (finishAlpha - startAlpha) / duration;

            rootCanvasGroup.alpha = startAlpha;

            while (!Math.HaveReachedValue(startAlpha, finishAlpha, rootCanvasGroup.alpha))
            {
                rootCanvasGroup.alpha += step * Time.deltaTime;
                yield return(null);
            }

            rootCanvasGroup.alpha = finishAlpha;
        }
Ejemplo n.º 2
0
        private IEnumerator FadingRoutine(float startIntensity, float finishIntensity, float duration)
        {
            var step = (finishIntensity - startIntensity) / duration;

            _vignetteVolume.weight = startIntensity;

            while (!Math.HaveReachedValue(startIntensity, finishIntensity, _vignetteVolume.weight))
            {
                _vignetteVolume.weight += step * Time.deltaTime;
                yield return(null);
            }

            _vignetteVolume.weight = finishIntensity;
        }
Ejemplo n.º 3
0
        private IEnumerator FadingRoutine(float startAlpha, float finishAlpha, float duration)
        {
            var step = (finishAlpha - startAlpha) / duration;

            overlay.color = color;
            overlay.color = overlay.color.SetAlpha(startAlpha);

            while (!Math.HaveReachedValue(startAlpha, finishAlpha, overlay.color.a))
            {
                overlay.color = overlay.color.AddAlpha(step * Time.deltaTime);
                yield return(null);
            }

            overlay.color = overlay.color.SetAlpha(finishAlpha);
        }