在unity项目中又yeld return 协同程序 延迟调用方法
就想在cocoscreater中也使用这种类型的操作方式 目前测试下来这种方式可行
async AllFill() {
var sleep = function (time) {
return new Promise(function (resolve, reject) {
setTimeout(function () {
resolve(null);
}, time);
})
};
while (true) {
await sleep(1000);
}
}