Commit 182fe4dc authored by 王勇霞's avatar 王勇霞

移除事件

parent dcb878ae
...@@ -733,5 +733,5 @@ export const ResJson = { ...@@ -733,5 +733,5 @@ export const ResJson = {
"name": "svga" "name": "svga"
} }
], ],
"path": "https://yun.duiba.com.cn/db_games/activity/template/1678772466/resource/" "path": "https://yun.duiba.com.cn/db_games/activity/template/1678886131/resource/"
} }
\ No newline at end of file
...@@ -114,6 +114,7 @@ export class GameScene extends Scene { ...@@ -114,6 +114,7 @@ export class GameScene extends Scene {
} }
upDateInfo() { upDateInfo() {
this.time = Tools.configInfo.time;
this.cdUIRender(this.time) this.cdUIRender(this.time)
this.startGame() this.startGame()
this.countDown(this.time) this.countDown(this.time)
...@@ -142,6 +143,9 @@ export class GameScene extends Scene { ...@@ -142,6 +143,9 @@ export class GameScene extends Scene {
timer = null; timer = null;
countDown(time) { countDown(time) {
if (this.timer) {
clearTimeout(this.timer);
}
this.timer = setTimeout(() => { this.timer = setTimeout(() => {
if (this.time <= 0) { if (this.time <= 0) {
clearTimeout(this.timer); clearTimeout(this.timer);
...@@ -329,7 +333,8 @@ export class GameScene extends Scene { ...@@ -329,7 +333,8 @@ export class GameScene extends Scene {
} }
removeEvents() { removeEvents() {
super.removeEvents(); super.removeEvents();
GDispatcher.addEventListener("closeGame", this.closeGame, this); clearTimeout(this.timer);
GDispatcher.removeEventListener("closeGame", this.closeGame, this);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment