Преглед на файлове

use new stopAnimation interface

fmmoret преди 7 години
родител
ревизия
17f34bac87
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      src/babylon.scene.ts

+ 3 - 3
src/babylon.scene.ts

@@ -2544,20 +2544,20 @@
          * @returns the animatable object created for this animation
          */
         public beginAnimation(target: any, from: number, to: number, loop?: boolean, speedRatio: number = 1.0, onAnimationEnd?: () => void, animatable?: Animatable, stopCurrent = true, targetMask?: (target: any) => boolean): Animatable {
-            const shouldRunTargetAnimations = targetMask ? targetMask(target) : true;
 
             if (from > to && speedRatio > 0) {
                 speedRatio *= -1;
             }
 
-            if (stopCurrent && shouldRunTargetAnimations) {
-                this.stopAnimation(target);
+            if (stopCurrent) {
+                this.stopAnimation(target, undefined, targetMask);
             }
 
             if (!animatable) {
                 animatable = new Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd);
             }
 
+            const shouldRunTargetAnimations = targetMask ? targetMask(target) : true;
             // Local animations
             if (target.animations && shouldRunTargetAnimations) {
                 animatable.appendAnimations(target, target.animations);