diff --git a/src/gameobjects/components/Pipeline.js b/src/gameobjects/components/Pipeline.js index 31415ff0b..10fe84ba3 100644 --- a/src/gameobjects/components/Pipeline.js +++ b/src/gameobjects/components/Pipeline.js @@ -359,7 +359,7 @@ var Pipeline = { }, /** - * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * Removes a type of Post Pipeline instances from this Game Object, based on the given name, and destroys them. * * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. * @@ -375,7 +375,7 @@ var Pipeline = { { var pipelines = this.postPipelines; - for (var i = 0; i < pipelines.length; i++) + for (var i = pipelines.length - 1; i >= 0; i--) { var instance = pipelines[i]; @@ -386,11 +386,11 @@ var Pipeline = { instance.destroy(); SpliceOne(pipelines, i); - - return this; } } + this.hasPostPipeline = (this.postPipelines.length > 0); + return this; },