IEnumerator FadeIn(float delta = 0.01f, ThenFunc then = null) { for (var f = 1f; f <= 1f; f -= delta) { var c = Curtain.color; c.a = f; Curtain.color = c; yield return(null); } then?.Invoke(); }
IEnumerator FadeOut(float delta = 0.01f, ThenFunc then = null) { for (var f = 0f; f <= 1f; f += delta) { var c = Curtain.color; c.a = f; Curtain.color = c; Debug.Log($"{f}"); yield return(null); } then?.Invoke(); }