Esempio n. 1
0
        protected override void InternalUpdate(float time)
        {
            float factor = 0.0f;

            if (time > 0.0f)
            {
                if (time < _duration)
                {
                    factor = _easing.Calculate(time, 0.0f, 1.0f, _duration);
                }
                else
                {
                    factor = 1.0f;
                }
            }
            _updater.Updating(factor);
        }
Esempio n. 2
0
 /// <summary>
 /// Calculate the easing to the specified time.
 /// </summary>
 /// <param name="easing">The easing</param>
 /// <param name="start">The start value.</param>
 /// <param name="target">The target value.</param>
 /// <param name="time">The current time.</param>
 /// <returns>
 /// The easing to the time.
 /// </returns>
 public static float Calculate(this IEasing easing, float start, float target, float time)
 {
     return(start + (target - start) * easing.Calculate(time));
 }