3.8.3 scheduleOnce bug

如果硬要解决的话,你可以先检查一下element是否被移除

那个 PR 就是解决循环过程中元素被删除的问题。

就改这里么?改这里解决不了问题的吧?

是的,改这里。你遇到的具体问题是什么呢?

所以这个问题怎么解决啊,3.8.3提出的问题为啥我3.8.5还有这个错,我是在预制体体里面引用其他预制体就可能会出现。我现在就是在移除那里新加了对element的判断 先让编辑器不卡死。各位大佬现在是怎么个方案。我不想使用定制引擎

import { Director, director, Scheduler } from “cc”;

(() => {

let afterUpdateFuc = () => {

    for (let one of cacheList) {

        unscheduleForTimer.apply(one[0], one[1]);

    }

    cacheList.length = 0;

};

director.on(Director.EVENT_AFTER_UPDATE, afterUpdateFuc);

let cacheList: any[] = [];

//@ts-ignore

let unscheduleForTimer: Function = Scheduler.prototype.unscheduleForTimer;

//@ts-ignore

Scheduler.prototype.unscheduleForTimer = function (...args) {

    cacheList.push([this, args]);

};

})();
看下这段代码能不能解决你的问题