Merge pull request #1264 from thecodingmachine/UpdateShowHideLayer
Show/Hide Layer now unset collision and can show/hide all the layer in a group layer
This commit is contained in:
commit
ae9af56661
3 changed files with 26 additions and 5 deletions
|
@ -192,6 +192,10 @@ export class GameMap {
|
|||
return this.phaserLayers.find((layer) => layer.layer.name === layerName);
|
||||
}
|
||||
|
||||
public findPhaserLayers(groupName: string): TilemapLayer[] {
|
||||
return this.phaserLayers.filter((l) => l.layer.name.includes(groupName));
|
||||
}
|
||||
|
||||
public addTerrain(terrain: Phaser.Tilemaps.Tileset): void {
|
||||
for (const phaserLayer of this.phaserLayers) {
|
||||
phaserLayer.tileset.push(terrain);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue