Esempio n. 1
0
        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)));
        }
Esempio n. 2
0
        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)));
        }
Esempio n. 3
0
        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)));
        }