js and ts no real coroutine。You need to stop asynchronous logic through code control, such as this
start () {
this.startCountDown();
},
async sleep(seconds){
return new Promise((resole) => setTimeout(resole, seconds * 1000));
},
async startCountDown() {
this._isStartCountDown = true;
await this.sleep(1);
if(this._isStartCountDown){
cc.log('checkEndGame')
//this.checkEndGame();
this.startCountDown();
}
},
stopCountDown(){
this._isStartCountDown = false;
},

