UI Toolbox logoUI Toolbox

GraphicsSettingsPanel and GraphicsOptions

A GraphicsSettingsPanel is a graphics settings screen that changes the real settings of the game. It is a PropertyGrid of GraphicsOptions with Defaults, Revert and Apply buttons.

<tb:GraphicsSettingsPanel prefs-key="mygame.graphics" confirm-seconds="15" />
Category Options
Display Display mode (FullScreenMode), resolution (a dropdown of Screen.resolutions), VSync, limit frame rate and maximum frame rate, horizontal field of view.
Quality The quality level (a dropdown of QualitySettings.names). With URP: render scale, upscaling filter, anti-aliasing and its quality, MSAA, HDR.
Shadows (URP) Shadows on the camera, shadow distance, shadow cascades.
Effects (URP) Post-processing, bloom, motion blur.
Member Description
Editing The options that the grid edits. Set a subclass of GraphicsOptions to add the options of a game.
Applied The options of the last Apply, or the saved options.
IsDirty True when Editing differs from Applied. Apply and Revert are enabled only then.
ApplyAsync() Sets Editing on the game and saves it. A display mode or resolution change asks "Keep these display settings?" and goes back after ConfirmSeconds without an answer. True when the edits stay.
Revert(), Defaults() Sets Editing to Applied, or to the settings when the game started.
PrefsKey (prefs-key) The PlayerPrefs key (tb.graphics). The panel loads the saved options on the first attach. Empty: Apply does not save.
ShowButtons (show-buttons) False hides the buttons, for a larger settings screen with its own buttons that call the methods.
ConfirmSeconds (confirm-seconds) The seconds of the keep box (15). 0: Apply does not ask.
Camera The camera of the field of view and the URP camera options. Null: Camera.main.
Grid The PropertyGrid.

GraphicsOptions works without the panel:

// At the start of the game: set the saved options
GraphicsOptions.LoadSaved("mygame.graphics").Apply(Camera.main);