Screen.width
public static int width ;
描述
屏幕窗口的当前宽度(以像素为单位)(只读)。
此为玩家窗口的实际宽度(在全屏模式下,它也是当前分辨率)。
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Example : MonoBehaviour { void Start() { //Output the current screen window width in the console Debug.Log("