void ApplySpeedFunction(TAE.Animation animation, List <int> speedFunction)
 {
     for (int i = 0; i < speedFunction.Count; i++)
     {
         int   speedPoints     = speedFunction[i];
         float speedMultiplier = (float)Math.Round(speedPoints * QuantizedSpeed, 2);
         if (!SpeedEffects.ContainsKey(speedMultiplier))
         {
             throw new KeyNotFoundException($"No speed effect with multiplier {speedMultiplier}");
         }
         float startTime = Tools.SnapTimeTo30FPS(i * FrameDuration);
         float endTime   = startTime + FrameDuration; // effect lasts only one frame
         animation.ApplyEffect(SpeedEffects[speedMultiplier], startTime, endTime);
     }
 }
예제 #2
0
파일: GameObject.cs 프로젝트: ICTSE1b5/KBS1
 //Effect Giving
 public void giveSpeedEffect(SpeedEffects effect)
 {
     currentSpeedEffectList.Add(effect);
 }