1
0
mirror of https://github.com/originalnicodr/CinematicUnityExplorer.git synced 2025-07-18 17:38:01 +08:00

fix: save default lod bias

This commit is contained in:
Scoolnik
2024-11-14 23:54:50 +05:00
committed by originalnicodr
parent 81d15270fe
commit 3928cdc4fe

View File

@ -48,6 +48,7 @@ namespace UnityExplorer.UI.Panels
Toggle HighLodToggle;
object qualitySettings = null;
PropertyInfo lodBias = null;
float _defaultLodBias = 1;
// We save the current properties of the Renderers and Lights to restore them after editing them with togglers
internal Dictionary<Renderer, bool> renderersReceiveShadows = new();
@ -122,9 +123,9 @@ namespace UnityExplorer.UI.Panels
if (lodBias == null){
Type qualitySettingsType = qualitySettings is Type type ? type : qualitySettings.GetActualType();
lodBias = qualitySettingsType.GetProperty("lodBias");
_defaultLodBias = (float)lodBias.GetValue(null);
}
lodBias.SetValue(null, areHighLodsOn ? 10000 : 1, null);
lodBias.SetValue(null, areHighLodsOn ? 10000 : _defaultLodBias, null);
}
private void ToggleAllMeshesCastAndRecieveShadows(bool enable){