浏览代码

Merge pull request #912 from Temechon/master

Fixed bug when an animation event was accessing new animated value
Raanan Weber 9 年之前
父节点
当前提交
399d1b845b
共有 1 个文件被更改,包括 3 次插入3 次删除
  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;
             }