Unity的分辨率

void GetResolution()
{
int width = Screen.currentResolution.width;
int height = Screen.currentResolution.height;

Resolution[] resolutions = Screen.resolutions;
foreach (var i in resolutions)
{
//print(i.width + "x" + i.height);
if(i.width==width&&i.height==height)
{
Debug.Log(i.height+"*"+i.width);
}

}
Screen.SetResolution(width, height, true);
}

猜你喜欢

转载自www.cnblogs.com/clhxxlcj/p/10955013.html