Commit 6e09585c authored by 范雪寒's avatar 范雪寒

feat: setInterval --> schedule

parent 273352d5
......@@ -54,7 +54,9 @@ var game = cc.Class({
//初始化游戏
this.initGame();
setInterval(() => {
const scheduler = cc.director.getScheduler();
scheduler.enableForTarget(this);
scheduler.schedule(() => {
if (g.data_mgr.gameState == 2) {
return;
}
......@@ -63,7 +65,7 @@ var game = cc.Class({
g.data_mgr.time = 0;
this.hintPlay();
}
}, 1000);
}, this, 1, cc.macro.REPEAT_FOREVER, 0, false);
//监听尺寸变化
if (window.addEventListener) {
......
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