Screen.resolutions

Switch to Manual
public static Resolution[] resolutions ;

Description

显示器支持的所有全屏分辨率(只读)。

返回的分辨率按宽度从低到高排序。注意,在 Android 设备上,该数组始终为空,因为分辨率是可变的(在合理范围内),没有可供选择的有限分辨率集合。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Start() { Resolution[] resolutions = Screen.resolutions; foreach (Resolution res in resolutions) { print(res.width + "x" + res.height); } Screen.SetResolution(resolutions[0].width, resolutions[0].height, true); } }

另请参阅:Resolution 结构、SetResolution