Skip to content

Commit 60c4201

Browse files
committed
Remove a type of Post Pipeline instances, not only a single instance
1 parent 60cc53f commit 60c4201

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/gameobjects/components/Pipeline.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ var Pipeline = {
341341
},
342342

343343
/**
344-
* Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it.
344+
* Removes a type of Post Pipeline instances from this Game Object, based on the given name, and destroys them.
345345
*
346346
* If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead.
347347
*
@@ -357,7 +357,7 @@ var Pipeline = {
357357
{
358358
var pipelines = this.postPipelines;
359359

360-
for (var i = 0; i < pipelines.length; i++)
360+
for (var i = pipelines.length - 1; i >= 0; i--)
361361
{
362362
var instance = pipelines[i];
363363

@@ -368,11 +368,11 @@ var Pipeline = {
368368
instance.destroy();
369369

370370
SpliceOne(pipelines, i);
371-
372-
return this;
373371
}
374372
}
375373

374+
this.hasPostPipeline = (this.postPipelines.length > 0);
375+
376376
return this;
377377
},
378378

0 commit comments

Comments
 (0)