private IEnumerator DoFade(Color from, Color to, float duration, EaseType ease, bool enableOnStart, bool disableOnComplete) { _isFadeAnimating = true; _fade.enabled |= enableOnStart; _fade.color = from; for (float t = 0; t < duration; t += Time.deltaTime) { _fade.color = Ease.Color(from, to, t / duration, ease); yield return(null); } _fade.color = to; _fade.enabled &= !disableOnComplete; _isFadeAnimating = false; }