Skip preupdate/update for PIXI hierarchies in which an ancestor doesn't exist

This commit is contained in:
Cameron Foale
2013-11-19 16:29:02 +11:00
parent e43571980d
commit 7ef5ab8c98
2 changed files with 17 additions and 6 deletions
+6 -2
View File
@@ -361,7 +361,9 @@ Phaser.Sprite.prototype.preUpdate = function() {
if (!this.exists || (this.group && !this.group.exists))
{
this.renderOrderID = -1;
return;
// Skip children if not exists
return false;
}
if (this.lifespan > 0)
@@ -371,7 +373,7 @@ Phaser.Sprite.prototype.preUpdate = function() {
if (this.lifespan <= 0)
{
this.kill();
return;
return false;
}
}
@@ -399,6 +401,8 @@ Phaser.Sprite.prototype.preUpdate = function() {
this.body.preUpdate();
}
return true;
};
/**