private IEnumerator CoFadeInVignette(float duration) { canvas.SetActive(true); for (float time = 0; time < duration; time += Time.deltaTime) { SetVignetteAlpha(MathX.EaseOutQuad(0, vignetteColor.a, time / duration)); yield return(null); } }
private IEnumerator CoDeselect() { for (float time = t * duration; time >= 0; time -= Time.deltaTime) { t = time / duration; SetLocalPosition(distance * MathX.EaseOutQuad(0, 1, t)); yield return(null); } t = 0; SetLocalPosition(Vector3.zero); }
private IEnumerator CoFadeOut() { for (float time = 0; time < fadeDuration; time += Time.deltaTime) { messageBubbleCanvasGroup.alpha = MathX.EaseOutQuad(1, 0, time / fadeDuration); yield return(null); } messageBubble.gameObject.SetActive(false); messageBubbleCanvasGroup.alpha = 1f; fadeOutRoutine = null; }
private IEnumerator CoSelect() { for (float time = t * duration; time < duration; time += Time.deltaTime) { t = time / duration; SetLocalPosition(distance * MathX.EaseOutQuad(0, 1, t)); yield return(null); } t = 1; SetLocalPosition(distance); }