GetWidth()
Gets the width of the window.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Method
- Namespace: UnityEngine.Windowing
- Assembly: UnityEngine.WindowingModule
public int GetWidth()
Returns
Type | Description |
|---|---|
| int | The width of the window in pixels. |
Examples
using UnityEngine;using UnityEngine.Windowing;public class WindowWidthExample : MonoBehaviour{ void Start() { var window = GameWindow.Main; int width = window.GetWidth(); Debug.Log($"Window width: {width}"); }}