//全屏设置(获取电脑的分辨率)
public class FullSceneSet : MonoBehaviour
{
void Start()
{
Resolution[] resolutions = Screen.resolutions;
int width = resolutions[resolutions.Length - 1].width;
int height = resolutions[resolutions.Length - 1].height;
print(“当前分辨率是:”+width +“x”+height);
//设置当前分辨率,设置为全屏窗口,去掉任务栏 最后一个参数和 Screen.fullScreen = false;一样
Screen.SetResolution(width, (int)(height * (1 - 0.074f)), false);
//如果Screen.fullScreen=false,那有最小化和退出按钮。如果为true则是布满屏幕,没有最小化和退出按钮
Screen.fullScreen = false;
//Cursor.lockState = CursorLockMode.Confined;
}
}