瀏覽代碼

Fixed detachPostProcess.

michael-korbas 11 年之前
父節點
當前提交
7fff7afa03
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Babylon/Cameras/babylon.camera.js

+ 2 - 2
Babylon/Cameras/babylon.camera.js

@@ -216,7 +216,6 @@ var BABYLON = BABYLON || {};
     BABYLON.Camera.prototype.detachPostProcess = function (postProcess, atIndices) {
         var result = [];
 
-        atIndices = (atIndices instanceof Array) ? atIndices : [atIndices];
 
         if (!atIndices) {
 
@@ -231,11 +230,12 @@ var BABYLON = BABYLON || {};
                 delete this._postProcesses[i];
 
                 var index = this._postProcessesTakenIndices.indexOf(i);
-                this._postProcessesTakenIndices.splice(i, 1);
+                this._postProcessesTakenIndices.splice(index, 1);
             }
 
         }
         else {
+            atIndices = (atIndices instanceof Array) ? atIndices : [atIndices];
             for (var i = 0; i < atIndices.length; i++) {
                 var foundPostProcess = this._postProcesses[atIndices[i]];