mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-31 23:29:27 +08:00
fix: 渲染元素销毁时不会删除id映射
This commit is contained in:
parent
5970c85dff
commit
fc8e666c3a
@ -405,6 +405,7 @@ export abstract class RenderItem<E extends ERenderItemEvent = ERenderItemEvent>
|
||||
this.remove();
|
||||
this.emit('destroy');
|
||||
this.removeAllListeners();
|
||||
RenderItem.itemMap.delete(this._id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -620,35 +620,6 @@ export function init() {
|
||||
callback?.();
|
||||
}, animateTime + 50);
|
||||
|
||||
// time /= Math.max(core.status.replay.speed, 1);
|
||||
// var per_time = 10,
|
||||
// step = 0,
|
||||
// steps = parseInt(time / per_time);
|
||||
// if (steps <= 0) {
|
||||
// this.setViewport(32 * x, 32 * y);
|
||||
// if (callback) callback();
|
||||
// return;
|
||||
// }
|
||||
// var px = core.clamp(32 * x, 0, 32 * core.bigmap.width - core._PX_);
|
||||
// var py = core.clamp(32 * y, 0, 32 * core.bigmap.height - core._PY_);
|
||||
// var cx = core.bigmap.offsetX;
|
||||
// var cy = core.bigmap.offsetY;
|
||||
// var moveFunc = core.applyEasing(moveMode);
|
||||
|
||||
// var animate = window.setInterval(function () {
|
||||
// step++;
|
||||
// core.setViewport(
|
||||
// cx + moveFunc(step / steps) * (px - cx),
|
||||
// cy + moveFunc(step / steps) * (py - cy)
|
||||
// );
|
||||
// if (step == steps) {
|
||||
// delete core.animateFrame.asyncId[animate];
|
||||
// clearInterval(animate);
|
||||
// core.setViewport(px, py);
|
||||
// if (callback) callback();
|
||||
// }
|
||||
// }, per_time);
|
||||
|
||||
const id = fallbackIds++;
|
||||
core.animateFrame.lastAsyncId = id;
|
||||
core.animateFrame.asyncId[id] = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user