This is a test ts code!
const {ccclass, property} = cc._decorator;
@ccclass
export default class Helloworld extends cc.Component {
@property(cc.Label)
label: cc.Label = null;
@property
text: string = 'hello';
start () {
this.startCountDownAsync();
},
async sleep(seconds){
return new Promise((resole) => setTimeout(resole, seconds * 1000));
},
async startCountDownAsync() {
await this.sleep(1);
this.startCountDown();
},
update(dt){
if (this._isStartCountDown) {
this.startCountDown();
}
},
async startCountDown() {
this._isStartCountDown = false;
await this.sleep(1);
cc.log('checkEndGame')
//this.checkEndGame();
this._isStartCountDown = true;
},
}

