File tree Expand file tree Collapse file tree
Assets/Gothic-Core/Scripts/Services/World Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,21 +144,26 @@ private void UpdateStateTexAndFog()
144144 Logger . LogError ( e . ToString ( ) , LogCat . Mesh ) ;
145145 return ;
146146 }
147+
148+ var fogColor = new Vector3 ( colorValues [ 0 ] , colorValues [ 1 ] , colorValues [ 2 ] ) ;
147149
148150 foreach ( var state in _stateList )
149151 {
150- // all states that contain day sky layer dawn, evening and day 0 to 3
151- if ( state . Time < 0.35 || state . Time > 0.65 )
152+ if ( ! ( state . Time < 0.35 ) || ! ( state . Time > 0.65 ) ) // set new textures only for day states
153+ {
154+ continue ;
155+ }
156+
157+ state . Layer [ 0 ] . TEXName = "SKYDAY_LAYER0_A" + day % 2 + ".TGA" ;
158+
159+ if ( ! ( state . Time < 0.3 ) || ! ( state . Time > 0.7 ) )
152160 {
153- state . Layer [ 0 ] . TEXName = "SKYDAY_LAYER0_A" + day % 2 + ".TGA" ;
154- // day states that contain sky cloud layer day 0 to 3
155- if ( state . Time < 0.3 || state . Time > 0.7 )
156- {
157- state . Layer [ 1 ] . TEXName = "SKYDAY_LAYER1_A" + day % 2 + ".TGA" ;
158- state . FogColor = new Vector3 ( colorValues [ 0 ] , colorValues [ 1 ] , colorValues [ 2 ] ) ;
159- state . DomeColor0 = new Vector3 ( colorValues [ 0 ] , colorValues [ 1 ] , colorValues [ 2 ] ) ;
160- }
161+ continue ;
161162 }
163+
164+ state . Layer [ 1 ] . TEXName = "SKYDAY_LAYER1_A" + day % 2 + ".TGA" ;
165+ state . FogColor = fogColor ;
166+ state . DomeColor0 = fogColor ;
162167 }
163168 }
164169
You can’t perform that action at this time.
0 commit comments