public static IEnumerator Opacity(this CanvasRenderer canvasRenderer, float to, float time, float delay = 0, Curve curve = null) { var start = canvasRenderer.GetAlpha(); var delta = to - start; return(Sequence.Create( Delay.Create(delay), TweenHelper.Process( opacity => canvasRenderer.SetAlpha(opacity), shift => start + delta * shift, time, curve))); }
public static IEnumerator Color(this Material material, Color to, float time, float delay = 0, Curve curve = null) { var start = material.color; var delta = to - start; return(Sequence.Create( Delay.Create(delay), TweenHelper.Process( color => material.color = color, shift => start + delta * shift, time, curve))); }
public static IEnumerator Scale(this Transform transform, Vector3 to, float time, float delay = 0, Curve curve = null) { var start = transform.localScale; var delta = to - start; return(Sequence.Create( Delay.Create(delay), TweenHelper.Process( scale => transform.localScale = scale, shift => start + delta * shift, time, curve))); }