Manager-owned persistence
Graphics preferences are stored through PlayerPrefs instead of SaveManager because these values
are user settings, not game progression.
GraphicsSettingsManager persistence example
private const string BrightnessKey = "EchoSystemsLab_Graphics_Brightness";
private const string UiScaleKey = "EchoSystemsLab_Graphics_UiScale";
public void SaveSettings()
{
PlayerPrefs.SetInt(ResolutionWidthKey, resolutionWidth);
PlayerPrefs.SetInt(ResolutionHeightKey, resolutionHeight);
PlayerPrefs.SetInt(WindowedKey, windowed ? 1 : 0);
PlayerPrefs.SetInt(QualityLevelKey, qualityLevel);
PlayerPrefs.SetInt(VSyncKey, vSyncEnabled ? 1 : 0);
PlayerPrefs.SetInt(TargetFrameRateKey, targetFrameRate);
PlayerPrefs.SetFloat(BrightnessKey, brightness);
PlayerPrefs.SetFloat(UiScaleKey, uiScale);
PlayerPrefs.Save();
}
Script-driven main menu routing
private void OpenGraphicsSettings()
{
if (graphicsSettingsMenuUI != null)
{
graphicsSettingsMenuUI.OpenFrom(mainMenuPanel);
return;
}
Debug.LogWarning("MainMenuController has no GraphicsSettingsMenuUI assigned.");
}
Live UI scale preview
private void HandleUiScaleChanged(float value)
{
if (isSyncingControls)
return;
pendingUiScale = value;
if (uiScaleApplier != null)
uiScaleApplier.PreviewScale(pendingUiScale);
RefreshValueLabels();
SetStatus("Pending graphics changes.");
}
Brightness overlay approach
if (brightness < 1f)
{
Color color = dimColor;
color.a = percent * maxDimAlpha;
overlayImage.color = color;
}
else
{
Color brighten = brightenColor;
brighten.a = brightenPercent * maxBrightenAlpha;
overlayImage.color = brighten;
}