mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 04:19:30 +08:00
fix: requestBeforeFrame三函数循环调用
This commit is contained in:
parent
582fdf5fe9
commit
21a4f62dcb
@ -468,17 +468,21 @@ export abstract class RenderItem<E extends ERenderItemEvent = ERenderItemEvent>
|
||||
}
|
||||
|
||||
RenderItem.ticker.add(() => {
|
||||
// slice 是为了让函数里面的 request 进入下一帧执行
|
||||
if (beforeFrame.length > 0) {
|
||||
beforeFrame.forEach(v => v());
|
||||
const arr = beforeFrame.slice();
|
||||
beforeFrame.splice(0);
|
||||
arr.forEach(v => v());
|
||||
}
|
||||
if (renderFrame.length > 0) {
|
||||
renderFrame.forEach(v => v());
|
||||
const arr = renderFrame.slice();
|
||||
renderFrame.splice(0);
|
||||
arr.forEach(v => v());
|
||||
}
|
||||
if (afterFrame.length > 0) {
|
||||
afterFrame.forEach(v => v());
|
||||
const arr = afterFrame.slice();
|
||||
afterFrame.splice(0);
|
||||
arr.forEach(v => v());
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user