Example #1
0
        /// <summary>
        /// Do not use with SCALE or FREERECT at same time!
        /// </summary>
        public void ScaleVec(EasingType easingEnum, int startTime, int endTime, float startVx, float startVy, float endVx,
                             float endVy)
        {
            float ms = _timing.Offset;

            if (!IsFinished && ms >= startTime && ms <= endTime)
            {
                var t = (ms - startTime) / (endTime - startTime);
                Vx.RealTime = startVx + (float)easingEnum.Ease(t) * (endVx - startVx);
                Vy.RealTime = startVy + (float)easingEnum.Ease(t) * (endVy - startVy);
            }

            if (ms >= VTime.Max)
            {
                Vx.RealTimeToTarget();
                Vy.RealTimeToTarget();
            }
        }