From 66aac4826e44edc3d52e01386320f8b03af6a154 Mon Sep 17 00:00:00 2001 From: min Date: Mon, 8 Jun 2026 15:57:03 +0300 Subject: [PATCH] =?UTF-8?q?debug:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BB=D0=BE=D0=B3=20lightingTimeUpdate=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=B4=D0=B8=D0=B0=D0=B3=D0=BD=D0=BE=D1=81=D1=82=D0=B8?= =?UTF-8?q?=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/editor/engine/GameRuntime.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/editor/engine/GameRuntime.js b/src/editor/engine/GameRuntime.js index 273ed31..2d2f777 100644 --- a/src/editor/engine/GameRuntime.js +++ b/src/editor/engine/GameRuntime.js @@ -213,16 +213,25 @@ export class GameRuntime { } } else if (cmd === 'lightingTimeUpdate') { // Roblox Lighting:SetMinutesAfterMidnight → Babylon небо. - // Скрипты делают это каждый кадр — троттлим до 4 раз/сек. const now = performance.now(); if (!this._lastLightUpdate || now - this._lastLightUpdate > 250) { this._lastLightUpdate = now; try { const hour = Number(payload?.hour); + // Debug-лог (первые несколько раз) + if (!this._lightDbgCount) this._lightDbgCount = 0; + if (this._lightDbgCount < 5) { + this._lightDbgCount++; + console.log('[lightingTimeUpdate]', { payload, hour, + hasSetTimeOfDay: typeof this.scene3d?.setTimeOfDay, + hasEnvironment: !!this.scene3d?.environment }); + } if (hour >= 0 && hour < 24) { this.scene3d?.setTimeOfDay?.(hour); } - } catch (_) {} + } catch (e) { + console.error('[lightingTimeUpdate] error:', e); + } } } else if (cmd === 'particleCreated') { // Roblox Instance.new('Sparkles') — запомнили какие