소스 검색

Adding index-- to iterate on all events

Temechon 9 년 전
부모
커밋
be966f5c0a
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      src/Animations/babylon.animation.js

+ 2 - 0
src/Animations/babylon.animation.js

@@ -93,6 +93,7 @@ var BABYLON;
             for (var index = 0; index < this._events.length; index++) {
                 if (this._events[index].frame === frame) {
                     this._events.splice(index, 1);
+                    index--;
                 }
             }
         };
@@ -394,6 +395,7 @@ var BABYLON;
                     // If event should be done only once, remove it.
                     if (event.onlyOnce) {
                         this._events.splice(index, 1);
+                        index--;
                     }
                     event.action();
                 }