GothicVRProject / GothicVR

Fan project recreating the classic Gothic I and II experience in VR.
GNU General Public License v3.0
24 stars 2 forks source link

fix(GothicSky.mat): Changes during Editor.OnValidate() removed as the… #349

Closed JaXt0r closed 2 months ago

JaXt0r commented 2 months ago

…y will be set at game startup without saving to .mat file directly.

Two major changes:

  1. I removed the OnValidate() function which calls SetShaderProperties() as this alters values inside GothicSky.mat before the game starts but should only reflect runtime changes. The SetShaderProperties() is also called during game startup which is: WorldCreator.CreateAsync() -> InitSky() -> Interpolate() -> InterpolateSky() -> SetShaderProperties() after world is loaded and before loading screne is gone.
  2. GothicSky was set directly on world.unity scene. Therefore we couldn't overwrite it. Now setting the value at runtime when world is fully loaded dynamically as a clone.

Tests showed the sky is fine at startup.