Add resolveRuntimeGlobalTimeState function and enhance runtime project time logic

This commit is contained in:
2026-04-13 15:54:16 +02:00
parent aea8d7d5a3
commit 989efdd53d
4 changed files with 271 additions and 11 deletions

View File

@@ -93,6 +93,7 @@ import {
createRuntimeClockState,
reconfigureRuntimeClockState,
resolveRuntimeDayNightWorldState,
resolveRuntimeTimeState,
type RuntimeClockState
} from "./runtime-project-time";
import { ThirdPersonNavigationController } from "./third-person-navigation-controller";
@@ -722,10 +723,16 @@ export class RuntimeHost {
return;
}
const resolvedTime =
this.currentClockState === null
? null
: resolveRuntimeTimeState(this.runtimeScene.time, this.currentClockState);
const resolvedWorld = resolveRuntimeDayNightWorldState(
this.currentWorld,
this.runtimeScene.time,
this.currentClockState
this.currentClockState,
resolvedTime
);
const backgroundTexture =
resolvedWorld.background.mode === "image"