Adding a "openWebsite" property that opens websites when we walk over the zone.

This commit is contained in:
David Négrier 2020-08-30 17:37:38 +02:00
parent 168697eb46
commit 01319b50ca
4 changed files with 36 additions and 9 deletions

View file

@ -29,6 +29,7 @@ import CanvasTexture = Phaser.Textures.CanvasTexture;
import GameObject = Phaser.GameObjects.GameObject;
import FILE_LOAD_ERROR = Phaser.Loader.Events.FILE_LOAD_ERROR;
import {GameMap} from "./GameMap";
import {CoWebsiteManager} from "../../WebRtc/CoWebsiteManager";
export enum Textures {
@ -415,8 +416,12 @@ export class GameScene extends Phaser.Scene implements CenterListener {
// From now, this game scene will be notified of reposition events
layoutManager.setListener(this);
this.gameMap.onPropertyChange('startLayer', (oldValue, newValue) => {
console.log('startLayer', oldValue, newValue);
this.gameMap.onPropertyChange('openWebsite', (newValue, oldValue) => {
if (newValue === undefined) {
CoWebsiteManager.closeCoWebsite();
} else {
CoWebsiteManager.loadCoWebsite(newValue as string);
}
});
}