Пример #1
0
 /// <summary>
 ///  Linearly interpolates between start and end values of type T using T's implementation of addition, multiplication, and negation.
 /// </summary>
 /// <typeparam name="T">Type of object to interpolate.</typeparam>
 /// <param name="start">Interpolation starting value.</param>
 /// <param name="end">Interpolation ending value.</param>
 /// <param name="t">Number from 0.0 to 1.0, where 0.0 corresponds to the starting value and 1.0 corresponds to the ending value.</param>
 /// <returns>Interpolated value.</returns>
 public T Interpolate(T start, T end, float t)
 {
     return(Interpolator.Interpolate(start, end, curve.Evaluate(t), add, Subtract, scale));
 }
Пример #2
0
 /// <summary>
 /// Linearly interpolates between start and end values over given amount of time.
 /// </summary>
 /// <typeparam name="T">Type of object to interpolate.</typeparam>
 /// <param name="start">Interpolation starting value.</param>
 /// <param name="end">Interpolation ending value.</param>
 /// <param name="time">Amount of time interpolation should take.</param>
 /// <param name="output">Method to pass current interpolated value to each frame.</param>
 /// <returns>A coroutine that will execute the interpolation.</returns>
 public IEnumerator Interpolate(T start, T end, float time, Action <T> output)
 {
     return(Interpolator.Interpolate(start, end, time, curve, output, add, Subtract, scale));
 }