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

posted @ 2019-05-31 14:17  玄~轩逸  阅读(787)  评论(0编辑  收藏  举报