public static IEnumerator FadeMaterialColor(this LineRenderer line, Color start, Color end, float time) { UnityAction <Color> setRendererColor = color => { line.material.color = color; }; yield return(ColorModule.Fade(start, end, time, setRendererColor)); }
public static IEnumerator Fade(this Image image, Color start, Color end, float time) { UnityAction <Color> colorUpdate = color => { image.color = color; }; yield return(ColorModule.Fade(start, end, time, colorUpdate)); }
public static IEnumerator Fade(this SpriteRenderer renderer, Color start, Color end, float time) { UnityAction <Color> setRendererColor = color => { renderer.color = color; }; yield return(ColorModule.Fade(start, end, time, setRendererColor)); }
public static IEnumerator FadeGradient(this LineRenderer line, Color start, Color end, float time, GradientFadeType fadeType = GradientFadeType.StartAndEnd) { UnityAction <Color> setRendererGradient = color => { if (fadeType == GradientFadeType.StartOnly || fadeType == GradientFadeType.StartAndEnd) { line.startColor = color; } if (fadeType == GradientFadeType.EndOnly || fadeType == GradientFadeType.StartAndEnd) { line.endColor = color; } }; yield return(ColorModule.Fade(start, end, time, setRendererGradient)); }