I’m trying to implement some graphical settings sliders into the Pause menu of a game I’m working on. Two of these settings are ‘Contrast’ and ‘Brightness’ in the ‘Color Adjustments’ component of a Volume Profile. Weirdly though, these both act differently in my pause menu when Time.TimeScale is set to 0.
A simplified version of my code is:
private void Start()
{
volumeProfile.TryGet(out colorAdjustments);
if (contrastSetting != null)
{
AdjustContrast(contrastSetting.Value);
contrastSetting.OnTypedValueChanged += (value) => AdjustContrast(value);
}
if (brightnessSetting != null)
{
AdjustBrightness(brightnessSetting.Value);
brightnessSetting.OnTypedValueChanged += (value) => AdjustBrightness(value);
}
}
public void AdjustContrast(float contrastValue)
{
if (colorAdjustments == null) return;
colorAdjustments.contrast.Override(contrastValue);
}
public void AdjustBrightness(float brightnessValue)
{
if (colorAdjustments == null) return;
Color c = colorAdjustments.colorFilter.value;
c.r = brightnessValue;
c.g = brightnessValue;
c.b = brightnessValue;
colorAdjustments.colorFilter.Override(c);
}
When moving the Brightness slider, the visual brightness updates instantly. But when moving the Contrast slider nothing visually happens until I exit the pause menu, which sets the Time.TimeScale to 1, and the contrast lerps to the value that I set.
I also noticed that changing the Contrast in the inspector directly also lerps the contrast visually, which solidified to me that updating this value relies on Time.TimeScale being non-zero.
Is this a bug? Is there a way to update these Post Processing settings instantly, without having to rely on Time.TimeScale being a non-zero number?