mirror of
https://github.com/wassname/phaser.git
synced 2026-10-29 13:21:16 +08:00
Fixed stupid error in destroy().
This commit is contained in:
1 parent
e45a929b00
commit
4562939e4e
7 files changed
+49
-6
No files matched your search
@@ -211,7 +211,14 @@ Phaser.BitmapText.prototype.destroy = function(destroyChildren) {
|
||||
|
||||
if (this.parent)
|
||||
{
|
||||
this.parent.remove(this);
|
||||
if (this.parent.instanceof Phaser.Group)
|
||||
{
|
||||
this.parent.remove(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.parent.removeChild(this);
|
||||
}
|
||||
}
|
||||
|
||||
var i = this.children.length;
|
||||
|
||||
@@ -148,7 +148,14 @@ Phaser.Graphics.prototype.destroy = function(destroyChildren) {
|
||||
|
||||
if (this.parent)
|
||||
{
|
||||
this.parent.remove(this);
|
||||
if (this.parent.instanceof Phaser.Group)
|
||||
{
|
||||
this.parent.remove(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.parent.removeChild(this);
|
||||
}
|
||||
}
|
||||
|
||||
var i = this.children.length;
|
||||
|
||||
@@ -376,7 +376,14 @@ Phaser.Image.prototype.destroy = function(destroyChildren) {
|
||||
|
||||
if (this.parent)
|
||||
{
|
||||
this.parent.remove(this);
|
||||
if (this.parent.instanceof Phaser.Group)
|
||||
{
|
||||
this.parent.remove(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.parent.removeChild(this);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.events)
|
||||
|
||||
@@ -499,7 +499,14 @@ Phaser.Sprite.prototype.destroy = function(destroyChildren) {
|
||||
|
||||
if (this.parent)
|
||||
{
|
||||
this.parent.remove(this);
|
||||
if (this.parent.instanceof Phaser.Group)
|
||||
{
|
||||
this.parent.remove(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.parent.removeChild(this);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.input)
|
||||
|
||||
@@ -191,7 +191,14 @@ Phaser.Text.prototype.destroy = function (destroyChildren) {
|
||||
|
||||
if (this.parent)
|
||||
{
|
||||
this.parent.remove(this);
|
||||
if (this.parent.instanceof Phaser.Group)
|
||||
{
|
||||
this.parent.remove(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.parent.removeChild(this);
|
||||
}
|
||||
}
|
||||
|
||||
this.texture.destroy();
|
||||
|
||||
@@ -291,7 +291,14 @@ Phaser.TileSprite.prototype.destroy = function(destroyChildren) {
|
||||
|
||||
if (this.parent)
|
||||
{
|
||||
this.parent.remove(this);
|
||||
if (this.parent.instanceof Phaser.Group)
|
||||
{
|
||||
this.parent.remove(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.parent.removeChild(this);
|
||||
}
|
||||
}
|
||||
|
||||
this.animations.destroy();
|
||||
|
||||
Reference in new issue
Block a user