Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PanelSettings

Defines a Panel Settings asset that instantiates a panel at runtime. The panel makes it possible for Unity to display UXML-file based UI in the Game view.
Read time 6 minutesLast updated 4 days ago

Definition

[HelpURL("UIE-Runtime-Panel-Settings")]public class PanelSettings : ScriptableObject

Remarks

The UIDocument component contains a reference to a PanelSettings object. The PanelSettings contains the rendering settings for the UI, including the scale mode and the sort order. Multiple UIDocument components can point to the same PanelSettings object, which optimizes performance when using multiple UI screens in the same scene.
For more information on the different properties of the PanelSettings object, refer to Panel Settings properties reference.

Fields

Value

Description

forceGammaRenderingForces the UI shader to output colors in the gamma color space.
textSettingsSpecifies a PanelTextSettings that will be used by every UI Document attached to the panel.

Properties

Property

Description

bindingLogLevelSets the log level for bindings in panels using this PanelSettings asset.
clearColorDetermines whether the color buffer is cleared before the panel is rendered.
clearDepthStencilDetermines whether the depth/stencil buffer is cleared before the panel is rendered.
colorClearValueThe color used to clear the color buffer.
depthClearValueThe depth used to clear the depth/stencil buffer.
dynamicAtlasSettingsSettings of the dynamic atlas.
extraVertexChannelsOptional per-vertex channels that custom ShaderGraph shaders attached to this panel can read.
fallbackDpiThe DPI value that Unity uses when it cannot determine the screen DPI.
matchDetermines whether Unity uses width, height, or a mix of the two as a reference when it scales the panel area.
referenceDpiThe DPI that the UI is designed for.
referenceResolutionThe resolution the UI is designed for.
referenceSpritePixelsPerUnitSprites have a Pixels Per Unit value that controls the pixel density of the sprite. For sprites that have the same Pixels Per Unit value as the Reference Pixels Per Unit value in the PanelSettings asset, the pixel density will be one to one.
renderModeDetermines how the panel is rendered. Defaults to PanelRenderMode.ScreenSpaceOverlay.
scaleA uniform scaling factor that Unity applies to elements in the panel before the panel transform.
scaleModeDetermines how elements in the panel scale when the screen size changes.
screenMatchModeSpecifies how to scale the panel area when the aspect ratio of the current resolution does not match the reference resolution.
sortingOrderWhen the Scene uses more than one panel, this value determines where this panel appears in the sorting order relative to other panels.
targetDisplaySet the display intended for the panel.
targetTextureSpecifies a Render Texture to render the panel's UI on.
textureSlotCountThe maximum number of textures that UI Toolkit can bind to the shader at once.
themeStyleSheetSpecifies a style sheet that Unity applies to every UI Document attached to the panel.
vertexBudgetThe expected number of vertices that will be used by this panel.

Methods

Method

Description

SetPanelChangeReceiverSets a custom IPanelChangeReceiver in the panelChangeReceiver setter to receive every change event. This method is available only in development builds and the editor, as it is a debug feature to go along the profiling of an application.
SetScreenToPanelSpaceFunctionSets the function that handles the transformation from screen space to panel space. For overlay panels, this function returns the input value.
SetScreenToPanelSpaceFunction3DSets the function that handles the transformation from screen space to panel space. For overlay panels, this function returns the input value.

Inheritance

Inherited Members

Operators

Operator

Description

operator ==Compares two object references to see if they refer to the same object.
boolDetermines whether the object exists.
operator !=Compares if two objects refer to a different object.