/// <summary>
        /// Creates a new Interpolator.
        /// </summary>
        /// <param name="start">The starting value.</param>
        /// <param name="end">The ending value.</param>
        /// <param name="length">The length of time, in seconds, to perform the interpolation.</param>
        /// <param name="scale">A delegate that handles converting the interpolator's progress to a value.</param>
        /// <param name="step">An optional callback to invoke when the Interpolator is updated.</param>
        /// <param name="completed">An optional callback to invoke when the Interpolator completes.</param>
        /// <returns>The Interpolator instance.</returns>
        public Interpolator Create(
            float start,
            float end,
            float length,
            InterpolatorScaleDelegate scale,
            Action <Interpolator> step,
            Action <Interpolator> completed)
        {
            lock (interpolators)
            {
                Interpolator i = interpolators.New();
                i.Reset(start, end, length, scale, step, completed);

                return(i);
            }
        }
Пример #2
0
 void OnHideMovementTutorial(bool fast)
 {
     if (MovementTutorialInterpolator == null)
     {
         MovementTutorialInterpolator = interpolators.Create(1f, 0f, (fast ? 0.3f : 1f), i => sunTutorialAlpha = i.Value, null);
     }
 }