int The width of the window in pixels.
Gets the width of the window.
using UnityEngine; using UnityEngine.Windowing;
public class WindowWidthExample : MonoBehaviour { void Start() { var window = GameWindow.Main; int width = window.GetWidth(); Debug.Log($"Window width: {width}"); } }