Beispiel #1
0
 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)));
 }
Beispiel #2
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)));
        }
Beispiel #3
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)));
        }
Beispiel #4
0
        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));
        }
Beispiel #5
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)));
        }
Beispiel #6
0
        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)));
        }