在Unity中获取移动设备类型

Get mobile device type in Unity

我想统一了解移动设备(如 iPhone X)。

https://www.theiphonewiki.com/wiki/Models

我通过这段代码知道了设备 运行 是否是 iPhone X...

if ( SystemInfo.deviceModel == “iPhone10,3”
|| SystemInfo.deviceModel == “iPhone10,6”)

但是,我怎么知道设备是 Samsung Galaxy S9 还是 LG V30?

使用相同的功能。

SystemInfo.deviceModel

https://docs.unity3d.com/ScriptReference/SystemInfo-deviceModel.html

Unity 还可以识别您的 OS(操作系统)。因此,您可以识别什么时候是 Android 设备、iOs 设备或​​ windows 平台,即使您在 Unity 编辑器上 运行。

如果您从事 VR 工作,您还可以识别具有 XR 的设备,Oculus、HTC、Cardboard 等设备