Commit 69f816ed authored by 范雪寒's avatar 范雪寒

feat: setInterval

parent 203375ba
......@@ -29,7 +29,7 @@ cc.Class({
let progressBar = pg.view.findComponent(this, cc.ProgressBar);
progressBar.progress = 0;
setInterval(() => {
this._interval = setInterval(() => {
if (!this.node.active) {
progressBar.progress = 0;
return;
......@@ -45,4 +45,9 @@ cc.Class({
update(dt) {
//1 60 2000 1
},
// 生命周期
onDestroy() {
clearInterval(this._interval);
},
});
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