import DateTime from "../scripts/help/DateTime"; const {ccclass, property} = cc._decorator; @ccclass export default class TickTest extends cc.Component { // LIFE-CYCLE CALLBACKS: // onLoad () {} public setTimeScale(touch,val){ cc.director.getScheduler().setTimeScale(val); } public startTick(){ Ticker.start(new Date().getTime()); } public stopTick(){ Ticker.stop(); } public pause(){ Ticker.pause(); } public repause(){ Ticker.resume(); } private timerId: string; public startItv() { this.removeItv(); this.timerId = Ticker.registerDelay(this.tick.bind(this), 1000); } private tick(count:number){ console.log( DateTime.formatDate()+ " tickļ¼š"+count) } public removeItv() { Ticker.unregisterDelay(this.timerId); } // update (dt) {} }