@@ -67,7 +67,7 @@ public async UniTask InitializeAsync(SkyboxTimeSettings pluginSettings, Cancella
6767 if ( settingsJson . DayCycleDurationInSeconds != null )
6868 skyboxSettings . FullDayCycleInSeconds = settingsJson . DayCycleDurationInSeconds . Value ;
6969
70- SetInitialTime ( settingsJson , skyboxSettings ) ;
70+ SetInitialTime ( settingsJson , skyboxSettings , skyboxTimeEnabled ) ;
7171
7272 skyboxRenderController = Object . Instantiate ( ( await assetsProvisioner . ProvideMainAssetAsync ( skyboxSettings . SkyboxRenderControllerPrefab , ct : ct ) ) . Value ) ;
7373
@@ -83,7 +83,8 @@ public async UniTask InitializeAsync(SkyboxTimeSettings pluginSettings, Cancella
8383 directionalLight ,
8484 skyboxAnimation ,
8585 skyboxSettings . TimeOfDayNormalized ,
86- lensFlareEnabled
86+ lensFlareEnabled ,
87+ freezeTime : ! skyboxTimeEnabled
8788 ) ;
8889
8990 if ( ! skyboxTimeEnabled )
@@ -101,8 +102,21 @@ public async UniTask InitializeAsync(SkyboxTimeSettings pluginSettings, Cancella
101102
102103 return ;
103104
104- void SetInitialTime ( SkyboxSettings jsonConfig , SkyboxSettingsAsset skyboxSettings )
105+ void SetInitialTime ( SkyboxSettings jsonConfig , SkyboxSettingsAsset skyboxSettings , bool timeEnabled )
105106 {
107+ // When skybox time is disabled, pin the initial time to noon so it's independent of host
108+ // clock / PlayerPrefs / FF — the update system that would honor those isn't injected here.
109+ if ( ! timeEnabled )
110+ {
111+ const float NOON = 0.5f ;
112+ skyboxSettings . TimeOfDayNormalized = NOON ;
113+ skyboxSettings . TargetTimeOfDayNormalized = NOON ;
114+ skyboxSettings . UIOverrideTimeOfDayNormalized = NOON ;
115+ skyboxSettings . IsUIControlled = true ;
116+ skyboxSettings . IsDayCycleEnabled = false ;
117+ return ;
118+ }
119+
106120 if ( DCLPlayerPrefs . HasKey ( DCLPrefKeys . SKYBOX_FIXED_TIME ) )
107121 {
108122 float fixedTime = DCLPlayerPrefs . GetFloat ( DCLPrefKeys . SKYBOX_FIXED_TIME ) ;
0 commit comments