unity中判断iphone设备型号的方法
# 在unity开发iphone app,特别是最近适配iphone x时,需要知道app目前运行的设备型号。可以通过SystemInfo.deviceModel获取设备型号,但是,获取的值是形如:iPhone8,1这种。这里有个表:
Model | Name |
---|---|
iPhone7,1 | iPhone 6 Plus |
iPhone7,2 | iPhone 6 |
iPhone8,1 | iPhone 6s |
iPhone8,2 | iPhone 6s Plus |
iPhone8,4 | iPhone SE |
iPhone9,1 | 国行、日版、港行iPhone 7 (A1660/A1779/A1780) |
iPhone9,2 | 港行、国行iPhone 7 Plus (A1661/A1785/A1786) |
iPhone9,3 | 美版、台版iPhone 7 (A1778) |
iPhone9,4 | 美版、台版iPhone 7 Plus (A1784) |
iPhone10,1 | 国行(A1863)、日行(A1906)iPhone 8 |
iPhone10,4 | 美版(Global/A1905)iPhone 8 |
iPhone10,2 | 国行(A1864)、日行(A1898)iPhone 8 Plus |
iPhone10,5 | 美版(Global/A1897)iPhone 8 Plus |
iPhone10,3 | 国行(A1865)、日行(A1902)iPhone X |
iPhone10,6 | 美版(Global/A1901)iPhone X |
# SystemInfo 详解
Rendering.CopyTextureSupport copyTextureSupport:(只读)支持多种复制纹理功能的情况。
string deviceModel:(只读)设备的模型或模式。
string deviceName:(只读)用户定义的设备名称。
DeviceType deviceType:(只读)返回程序运行所在的设备类型(PC电脑、掌上型等)。
string deviceUniqueIdentifier:(只读)设备的唯一标识符。每一台设备都有唯一的标识符。
int graphicsDeviceID:(只读)显卡的唯一标识符ID。
string graphicsDeviceName:(只读)显卡的名称。
Rending.GraphicsDeviceType graphicsDeviceType:(只读)显卡的类型。
string graphicsDeviceVendor:(只读)显卡的供应商。
int graphicsDeviceVendorID:(只读)显卡供应商的唯一识别码ID。
string graphicsDeviceVersion:(只读)显卡的类型和版本。
int graphicsMemorySize:(只读)显存大小。
bool graphicsMultiThreaded:(只读)是否支持多线程渲染?
int graphicsShaderLevel:(只读)显卡着色器的级别。
int maxTextureSize:(只读)支持的最大纹理大小。
NPOTSupport npotSupport:(只读)GPU支持的NPOT纹理。
string operatingSystem:(只读)操作系统的版本名称。
int processorCount:(只读)当前处理器的数量。
int processorFrequency:(只读)处理器的频率。
string processorType:(只读)处理器的名称。
int supportedRenderTargetCount:(只读)支持渲染多少目标纹理。
bool supports2DArrayTextures:(只读)是否支持2D数组纹理。
bool supports3DTextures:(只读)是否支持3D(体积)纹理。
bool supportsAccelerometer:(只读)是否支持获取加速度计。
bool supportsAudio:(只读)是否支持获取用于回放的音频设备。
bool supportsComputeShaders:(只读)是否支持计算着色器。
bool supportsGyroscope:是否支持获取陀螺仪。
bool supportsImageEffects:(只读)是否支持图形特效。
bool supportsInstancing:(只读)是否支持实例化GPU的Draw Call。
bool supportsLocationService:是否支持定位功能。
bool supportsMotionVectors:是否支持运动向量。
bool supportsRawShadowDepthSampling:(只读)是否支持阴影深度。
bool supportsRenderTextures:(只读)是否支持渲染纹理。
bool supportsRenderToCubemap:(只读)是否支持立方体纹理。
bool supportsShadows:(只读)是否支持内置阴影。
bool supportsSparseTextures:(只读)是否支持稀疏纹理。
bool supportsStencil:(只读)是否支持模版缓存。
bool supportsVibration:是否支持用户触摸震动反馈。
int systemMemorySize:(只读)系统内存大小。
string unsupportedIdentifier:不支持运行在当前设备的SystemInfo属性值。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
上次更新: 2023/10/16, 17:53:06