Merge pull request #5467 from rexrainbow/improve-postfx-pipeline

Remove a type of Post Pipeline instances, not only a single instance
This commit is contained in:
Richard Davey 2021-01-04 16:14:48 +00:00 committed by GitHub
commit c124d4c0a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,10 +386,10 @@ var Pipeline = {
instance.destroy();
SpliceOne(pipelines, i);
}
}
return this;
}
}
this.hasPostPipeline = (this.postPipelines.length > 0);
return this;
},