Prechádzať zdrojové kódy

Merge pull request #1754 from wyklion/master

check animations all stop bug.
David Catuhe 8 rokov pred
rodič
commit
2c0ed72f85
1 zmenil súbory, kde vykonal 2 pridanie a 4 odobranie
  1. 2 4
      src/Animations/babylon.animatable.ts

+ 2 - 4
src/Animations/babylon.animatable.ts

@@ -107,7 +107,6 @@
                 if (idx > -1) {
 
                     var animations = this._animations;
-                    var numberOfAnimationsStopped = 0;
                     
                     for (var index = animations.length - 1; index >= 0; index--) {
                         if (typeof animationName === "string" && animations[index].name != animationName) {
@@ -116,10 +115,9 @@
 
                         animations[index].reset();
                         animations.splice(index, 1);
-                        numberOfAnimationsStopped++;
                     }
 
-                    if (animations.length == numberOfAnimationsStopped) {
+                    if (animations.length == 0) {
                         this._scene._activeAnimatables.splice(idx, 1);
 
                         if (this.onAnimationEnd) {
@@ -191,4 +189,4 @@
             return running;
         }
     }
-} 
+}