Ver código fonte

Merge pull request #912 from Temechon/master

Fixed bug when an animation event was accessing new animated value
Raanan Weber 9 anos atrás
pai
commit
399d1b845b
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3 3
      src/Animations/babylon.animation.ts

+ 3 - 3
src/Animations/babylon.animation.ts

@@ -453,6 +453,9 @@
             var currentFrame = returnValue ? from + ratio % range : to;
             var currentValue = this._interpolate(currentFrame, repeatCount, this.loopMode, offsetValue, highLimitValue);
 
+            // Set value
+            this.setValue(currentValue);
+
             // Check events
             for (var index = 0; index < this._events.length; index++) {
                 if (currentFrame >= this._events[index].frame) {
@@ -472,9 +475,6 @@
                 }
             }
 
-            // Set value
-            this.setValue(currentValue);
-
             if (!returnValue) {
                 this._stopped = true;
             }