fix(player): scene.setLabel — import LabelManager вместо require (require крашит в браузере)

ReferenceError: require is not defined при game.self.setLabel/scene.setLabel
в плеере. Заменён require('./LabelManager') на статический import (как в студии).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
min 2026-06-06 11:56:34 +03:00
parent b87d1e2525
commit d08497ef3b

View File

@ -17,6 +17,7 @@
import { Color3 } from '@babylonjs/core';
import { ScriptSandbox } from './ScriptSandbox';
import { STORYS_addres } from '../api/API';
import { LabelManager } from './LabelManager'; // задача: scene.setLabel (require крашит в браузере)
export class GameRuntime {
constructor(scene3d) {
@ -2767,7 +2768,6 @@ export class GameRuntime {
if (typeof ref !== 'string') return;
// ленивое создание менеджера меток
if (!this.scene3d._labelManager) {
const { LabelManager } = require('./LabelManager');
this.scene3d._labelManager = new LabelManager(this.scene3d.scene);
}
const lm = this.scene3d._labelManager;