public static IEnumerator Opacity(this CanvasRenderer render, float to, float time, float delay = 0, Curve curve = null) { return(Sequence.Create( Delay.Create(delay), ProcessOpacity( render, to, time, curve))); }
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 Move(this GameObject gameObject, Vector3 position, float time, float delay = 0, Curve curve = null) { var transform = gameObject.transform; return Sequence.Create( Delay.Create(delay), ProcessMoving( transform, position, 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))); }
public static IEnumerator Scale(this GameObject gameObject, Vector3 scale, float time, float delay = 0, Curve curve = null) { var transform = gameObject.transform; return(Sequence.Create( Delay.Create(delay), ProcessScaling( transform, scale, time, delay, curve))); }