private static IEnumerable <Vector3> NewCatmullRom <T>(IList nodes, XInterpolate.ToVector3 <T> toVector3, int slices, bool loop) { if (nodes.Count >= 2) { yield return(toVector3((T)((object)nodes[0]))); int num = nodes.Count - 1; int num2 = 0; while (loop || num2 < num) { if (loop && num2 > num) { num2 = 0; } int index = (num2 == 0) ? (loop ? num : num2) : (num2 - 1); int index2 = num2; int num3 = (num2 == num) ? (loop ? 0 : num2) : (num2 + 1); int index3 = (num3 == num) ? (loop ? 0 : num3) : (num3 + 1); int num4 = slices + 1; for (int i = 1; i <= num4; i++) { yield return(XInterpolate.CatmullRom(toVector3((T)((object)nodes[index])), toVector3((T)((object)nodes[index2])), toVector3((T)((object)nodes[num3])), toVector3((T)((object)nodes[index3])), (float)i, (float)num4)); } num2++; } } yield break; }
private static IEnumerator NewEase(XInterpolate.Function ease, Vector3 start, Vector3 end, float total, IEnumerable <float> driver) { Vector3 distance = end - start; foreach (float elapsedTime in driver) { yield return(XInterpolate.Ease(ease, start, distance, elapsedTime, total)); } yield break; }
private static IEnumerable <Vector3> NewBezier <T>(XInterpolate.Function ease, IList nodes, XInterpolate.ToVector3 <T> toVector3, float maxStep, IEnumerable <float> steps) { if (nodes.Count >= 2) { Vector3[] array = new Vector3[nodes.Count]; foreach (float elapsedTime in steps) { for (int i = 0; i < nodes.Count; i++) { array[i] = toVector3((T)((object)nodes[i])); } yield return(XInterpolate.Bezier(ease, array, elapsedTime, maxStep)); } } yield break; }
public static IEnumerator NewEase(XInterpolate.Function ease, Vector3 start, Vector3 end, int slices) { IEnumerable <float> driver = XInterpolate.NewCounter(0, slices + 1, 1); return(XInterpolate.NewEase(ease, start, end, (float)(slices + 1), driver)); }
public static IEnumerator NewEase(XInterpolate.Function ease, Vector3 start, Vector3 end, float duration) { IEnumerable <float> driver = XInterpolate.NewTimer(duration); return(XInterpolate.NewEase(ease, start, end, duration, driver)); }
public static IEnumerable <Vector3> NewCatmullRom(Vector3[] points, int slices, bool loop) { return(XInterpolate.NewCatmullRom <Vector3>(points, new XInterpolate.ToVector3 <Vector3>(XInterpolate.Identity), slices, loop)); }
public static IEnumerable <Vector3> NewCatmullRom(Transform[] nodes, int slices, bool loop) { return(XInterpolate.NewCatmullRom <Transform>(nodes, new XInterpolate.ToVector3 <Transform>(XInterpolate.TransformDotPosition), slices, loop)); }
public static IEnumerable <Vector3> NewBezier(XInterpolate.Function ease, Vector3[] points, int slices) { IEnumerable <float> steps = XInterpolate.NewCounter(0, slices + 1, 1); return(XInterpolate.NewBezier <Vector3>(ease, points, new XInterpolate.ToVector3 <Vector3>(XInterpolate.Identity), (float)(slices + 1), steps)); }
public static IEnumerable <Vector3> NewBezier(XInterpolate.Function ease, Vector3[] points, float duration) { IEnumerable <float> steps = XInterpolate.NewTimer(duration); return(XInterpolate.NewBezier <Vector3>(ease, points, new XInterpolate.ToVector3 <Vector3>(XInterpolate.Identity), duration, steps)); }
public static IEnumerable <Vector3> NewBezier(XInterpolate.Function ease, Transform[] nodes, int slices) { IEnumerable <float> steps = XInterpolate.NewCounter(0, slices + 1, 1); return(XInterpolate.NewBezier <Transform>(ease, nodes, new XInterpolate.ToVector3 <Transform>(XInterpolate.TransformDotPosition), (float)(slices + 1), steps)); }
public static IEnumerable <Vector3> NewBezier(XInterpolate.Function ease, Transform[] nodes, float duration) { IEnumerable <float> steps = XInterpolate.NewTimer(duration); return(XInterpolate.NewBezier <Transform>(ease, nodes, new XInterpolate.ToVector3 <Transform>(XInterpolate.TransformDotPosition), duration, steps)); }