Commit 3b680f1f authored by 范雪寒's avatar 范雪寒

feat: asyncDelay修改

parent 6f442f85
...@@ -177,9 +177,12 @@ export function playAudio(audioClip, cb = null) { ...@@ -177,9 +177,12 @@ export function playAudio(audioClip, cb = null) {
export async function asyncDelay(time) { export async function asyncDelay(time) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
try { try {
setTimeout(() => { cc.tween(cc.find('Canvas'))
.delay(time)
.call(()=>{
resolve(null); resolve(null);
}, time * 1000); })
.start();
} catch (e) { } catch (e) {
reject(e); reject(e);
} }
......
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