기술 자료

Unity Engine

Unity Engine

GetWidth()

Gets the width of the window.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

public int GetWidth()

Returns

Type

Description

intThe 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}"); }}