diff --git a/src/editor/engine/ScriptSandboxWorker.js b/src/editor/engine/ScriptSandboxWorker.js index 067b2b9..298ea6d 100644 --- a/src/editor/engine/ScriptSandboxWorker.js +++ b/src/editor/engine/ScriptSandboxWorker.js @@ -2593,6 +2593,10 @@ const game = { opts = opts && typeof opts === 'object' ? opts : {}; this._opts = opts; this._active = true; + // Колбэки можно передавать прямо в опциях show({ onPlay, onShow, onHide }). + if (typeof opts.onPlay === 'function') this._onPlay.push(opts.onPlay); + if (typeof opts.onShow === 'function') this._onShow.push(opts.onShow); + if (typeof opts.onHide === 'function') this._onHide.push(opts.onHide); // 1) Заблокировать управление игроком (наблюдатель). _send('player.setInputBlocked', { blocked: true }); game.hud.setVisible(false);