Exemplo n.º 1
0
        /**
         * Instead of easing based on time, generate n interpolated points (slices)
         * between the start and end positions.
         */
        public static IEnumerator NewEase(Function ease, Vector3 start, Vector3 end, int slices)
        {
            IEnumerable <float> counter = Interpolate.NewCounter(0, slices + 1, 1);

            return(NewEase(ease, start, end, slices + 1, counter));
        }
Exemplo n.º 2
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));
        }
Exemplo n.º 3
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));
        }