[Unity] Debug 查看 Device Simulator 的屏幕尺寸

331 阅读1分钟

在以前,Device Simulator 是有屏幕尺寸的菜单显示的,例如这个教程展示的那样

gamedevacademy.org/unity-devic…

图片.png

但是现在我 unity2021 版本的没有了

查了一下,是在更新中被删掉了

community.gamedev.tv/t/device-si…

看了一下,别人都是直接 Debug 出 Screen.width

forum.unity.com/threads/get…

然后我也没有搜到 unity 内部配置这些 device 的 json 放在哪

那就只好 Debug 了

private void Start()
{
    Debug.Log(Screen.width);
    Debug.Log(Screen.height);
}