feat(rbxl): XML-������ ������ .rbxl + Day/Night + Tool/Mouse/Backpack flow #38
@ -213,16 +213,25 @@ export class GameRuntime {
|
|||||||
}
|
}
|
||||||
} else if (cmd === 'lightingTimeUpdate') {
|
} else if (cmd === 'lightingTimeUpdate') {
|
||||||
// Roblox Lighting:SetMinutesAfterMidnight → Babylon небо.
|
// Roblox Lighting:SetMinutesAfterMidnight → Babylon небо.
|
||||||
// Скрипты делают это каждый кадр — троттлим до 4 раз/сек.
|
|
||||||
const now = performance.now();
|
const now = performance.now();
|
||||||
if (!this._lastLightUpdate || now - this._lastLightUpdate > 250) {
|
if (!this._lastLightUpdate || now - this._lastLightUpdate > 250) {
|
||||||
this._lastLightUpdate = now;
|
this._lastLightUpdate = now;
|
||||||
try {
|
try {
|
||||||
const hour = Number(payload?.hour);
|
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) {
|
if (hour >= 0 && hour < 24) {
|
||||||
this.scene3d?.setTimeOfDay?.(hour);
|
this.scene3d?.setTimeOfDay?.(hour);
|
||||||
}
|
}
|
||||||
} catch (_) {}
|
} catch (e) {
|
||||||
|
console.error('[lightingTimeUpdate] error:', e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (cmd === 'particleCreated') {
|
} else if (cmd === 'particleCreated') {
|
||||||
// Roblox Instance.new('Sparkles') — запомнили какие
|
// Roblox Instance.new('Sparkles') — запомнили какие
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user