我们正在使用 Unity 开发桌面应用程序,之前我们使用的是 Unity 4。现在我们已经将项目升级到Unity 5 (5.2.1)。我们在设置屏幕分辨率时遇到问题。我们在Unity 4中使用Screen.SetResolution(Screen.currentResolution.width, Screen.currentResolution.height, true);
来设置分辨率并且工作正常,但在Unity 5中,Screen. currentResolution.width
没有给出正确的值。
Unity 5.2.1 是否有任何新功能可能导致此问题?
最佳答案
听起来您正在寻找:
http://docs.unity3d.com/ScriptReference/Screen-width.html http://docs.unity3d.com/ScriptReference/Screen-height.html
或者:
http://docs.unity3d.com/ScriptReference/Resolution-width.html http://docs.unity3d.com/ScriptReference/Resolution-height.html
如果您的播放器认为它正在窗口模式下运行,当前分辨率可能只会给您带来预期的结果?
http://docs.unity3d.com/ScriptReference/Screen-currentResolution.html
关于screen-resolution - Unity 5.2.1 的 Screen.currentResolution,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33117150/