mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
Added new argument removeFromTilemap
This commit is contained in:
parent
d63321eba5
commit
0514d27efc
2 changed files with 18 additions and 4 deletions
|
@ -451,16 +451,23 @@ var DynamicTilemapLayer = new Class({
|
|||
*
|
||||
* @method Phaser.Tilemaps.DynamicTilemapLayer#destroy
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {boolean} [removeFromTilemap=true] - Remove this layer from the parent Tilemap?
|
||||
*/
|
||||
destroy: function ()
|
||||
destroy: function (removeFromTilemap)
|
||||
{
|
||||
if (removeFromTilemap === undefined) { removeFromTilemap = true; }
|
||||
|
||||
// Uninstall this layer only if it is still installed on the LayerData object
|
||||
if (this.layer.tilemapLayer === this)
|
||||
{
|
||||
this.layer.tilemapLayer = undefined;
|
||||
}
|
||||
|
||||
if (removeFromTilemap)
|
||||
{
|
||||
this.tilemap.removeLayer(this);
|
||||
}
|
||||
|
||||
this.tilemap = undefined;
|
||||
this.layer = undefined;
|
||||
|
|
|
@ -1439,16 +1439,23 @@ var StaticTilemapLayer = new Class({
|
|||
*
|
||||
* @method Phaser.Tilemaps.StaticTilemapLayer#destroy
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {boolean} [removeFromTilemap=true] - Remove this layer from the parent Tilemap?
|
||||
*/
|
||||
destroy: function ()
|
||||
destroy: function (removeFromTilemap)
|
||||
{
|
||||
if (removeFromTilemap === undefined) { removeFromTilemap = true; }
|
||||
|
||||
// Uninstall this layer only if it is still installed on the LayerData object
|
||||
if (this.layer.tilemapLayer === this)
|
||||
{
|
||||
this.layer.tilemapLayer = undefined;
|
||||
}
|
||||
|
||||
if (removeFromTilemap)
|
||||
{
|
||||
this.tilemap.removeLayer(this);
|
||||
}
|
||||
|
||||
this.tilemap = undefined;
|
||||
this.layer = undefined;
|
||||
|
|
Loading…
Reference in a new issue