Example #1
0
        /**
         * Returns sequence generator from the first node to the last node over
         * duration time using the points in-between the first and last node
         * as control points of a bezier curve used to generate the interpolated points
         * in the sequence. If there are no control points (ie. only two nodes, first
         * and last) then this behaves exactly the same as NewEase(). In other words
         * a zero-degree bezier spline curve is just the easing method. The sequence
         * is generated as it is accessed using the Time.deltaTime to calculate the
         * portion of duration that has elapsed.
         */
        public static IEnumerable <Vector3> NewBezier(Function ease, Transform[] nodes, float duration)
        {
            IEnumerable <float> timer = Interpolate.NewTimer(duration);

            return(NewBezier <Transform>(ease, nodes, TransformDotPosition, duration, timer));
        }
Example #2
0
        /**
         * Returns sequence generator from start to end over duration using the
         * given easing function. The sequence is generated as it is accessed
         * using the Time.deltaTime to calculate the portion of duration that has
         * elapsed.
         */
        public static IEnumerator NewEase(Function ease, Vector3 start, Vector3 end, float duration)
        {
            IEnumerable <float> timer = Interpolate.NewTimer(duration);

            return(NewEase(ease, start, end, duration, timer));
        }