MainUI.ts
namespace edwin {
export class MainUI extends eui.Component {
protected createChildren(): void {
super.createChildren();
this.percentWidth = this.percentHeight = 100;
eui.Watcher.watch(this, ['visible'], (e) => this.do(e), this);
this.visible = false; // 停止遊戲動畫
this.visible = true; // 播放遊戲動畫
}
private do(visible: boolean): void {
if (visible) {
console.log('播放遊戲動畫');
} else {
console.log('停止遊戲動畫');
}
}
}
}
沒有留言:
張貼留言