From 60c42016b6ca4cb27c09fbda64413abb1aa58cea Mon Sep 17 00:00:00 2001 From: Rex Date: Fri, 25 Dec 2020 17:05:50 +0800 Subject: [PATCH] Remove a type of Post Pipeline instances, not only a single instance --- src/gameobjects/components/Pipeline.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gameobjects/components/Pipeline.js b/src/gameobjects/components/Pipeline.js index 1231be3b5..71aec3926 100644 --- a/src/gameobjects/components/Pipeline.js +++ b/src/gameobjects/components/Pipeline.js @@ -341,7 +341,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. * @@ -357,7 +357,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]; @@ -368,11 +368,11 @@ var Pipeline = { instance.destroy(); SpliceOne(pipelines, i); - - return this; } } + this.hasPostPipeline = (this.postPipelines.length > 0); + return this; },