ソースを参照

Merge pull request #5241 from sebavan/master

My Bad 2 ...
David Catuhe 7 年 前
コミット
f1a423d7f9
1 ファイル変更4 行追加1 行削除
  1. 4 1
      src/babylon.sceneComponent.ts

+ 4 - 1
src/babylon.sceneComponent.ts

@@ -205,9 +205,12 @@
         public registerStep(index: number, component: ISceneComponent, action: T): void {
             let i = 0;
             let maxIndex = Number.MAX_VALUE;
-            for (; i < this.length && i < maxIndex; i++) {
+            for (; i < this.length; i++) {
                 let step = this[i];
                 maxIndex = step.index;
+                if (index < maxIndex) {
+                    break;
+                }
             }
             this.splice(i, 0, { index, component, action: action.bind(component) });
         }