Show/Hide Layer now unset collision and can show/hide all the layer in a group layer

This commit is contained in:
GRL
2021-07-07 14:26:53 +02:00
parent a7ced533c0
commit d51ac45079
4 changed files with 38 additions and 16 deletions
+4
View File
@@ -189,6 +189,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);