ZhangXianQiang
2024-04-26 2e94a8b8704d1cca44e4f3d7cb55daa6d20a79fd
src/views/screen/components/screen-map-three/experience/utils/time.js
@@ -6,6 +6,7 @@
        this.current = this.start;
        this.elapsed = 0;
        this.delta = 16;
        // 合适的时机执行loop循环
        window.requestAnimationFrame(() => {
            this.tick();
        });
@@ -17,9 +18,14 @@
        this.current = currentTime;
        this.elapsed = this.current - this.start;
        this.trigger('tick');
        window.requestAnimationFrame(() => {
        this.loopId = window.requestAnimationFrame(() => {
            this.tick();
        });
    }
    destroy() {
        window.cancelAnimationFrame(this.loopId);
        this.off('tick');
    }
}