Resolution A Resolution object that represents the current resolution of the window.
Gets the resolution of the window.
If the window is running in windowed mode, this function retrieves the window’s resolution, in contrast to Screen.currentResolution, which returns the resolution of the display. Note that the fetched resolution refresh rate defaults to 0 if retrieving the window's refresh rate isn't supported on the current platform.
using UnityEngine; using UnityEngine.Windowing;
public class WindowResolutionExample : MonoBehaviour { void Start() { var window = GameWindow.Main; Resolution res = window.GetResolution(); Debug.Log($"Resolution: {res.width}x{res.height} @ {res.refreshRate}Hz"); } }