SystemInfo获取系统参数
生活随笔
收集整理的這篇文章主要介紹了
SystemInfo获取系统参数
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
System類可以指出Unity項目的一些設備信息。
一些常用的靜態屬性:
SystemInfo.deviceModel //設備模型(string) SystemInfo.deviceName //設備名稱(string) SystemInfo.deviceType //設備類型(enum) public enum DeviceType {Unknown = 0,Handheld = 1, //手持設備,如手機,平板Console = 2, //游戲機Desktop = 3 //臺式電腦,筆記本電腦 } SystemInfo.systemMemorySize //系統內存大小MB(int) SystemInfo.operatingSystem //操作系統(string) SystemInfo.deviceUniqueIdentifier //設備唯一標識符(string) SystemInfo.graphicsDeviceID //顯卡ID(int) SystemInfo.graphicsDeviceName //顯卡名稱(string) SystemInfo.graphicsDeviceType //顯卡類型(enum) public enum GraphicsDeviceType {OpenGL2 = 0, //OpenGL 2.x graphics API.Direct3D9 = 1, //Direct3D 9 graphics API.Direct3D11 = 2,PlayStation3 = 3,Null = 4,Xbox360 = 6,OpenGLES2 = 8,OpenGLES3 = 11,PlayStationVita = 12,PlayStation4 = 13,XboxOne = 14,PlayStationMobile = 15,Metal = 16,OpenGLCore = 17,Direct3D12 = 18,Nintendo3DS = 19 } SystemInfo.graphicsDeviceVendor //顯卡供應商(string) SystemInfo.graphicsDeviceVendorID //顯卡供應唯一ID(int) SystemInfo.graphicsDeviceVersion //顯卡版本號(int) SystemInfo.graphicsMemorySize //顯存大小MB(int) SystemInfo.graphicsMultiThreaded //顯卡是否支持多線程渲染(bool) SystemInfo.supportedRenderTargetCount //支持的渲染目標數量(int)案例:
1/ 在聯想筆記本電腦Unity編輯器中里:(轉成string后打印)
2/ 在聯想筆記本電腦exe中:(轉成string后打印)
//其他都一樣,顯卡不一樣,可能是雙顯的原因: 設備唯一標識符:024637c25cad463cff9cb08a***************(一長串) 顯卡ID:26656 顯卡名稱:AMD Radeon(TM)R9 M375 顯卡類型:Direct3D11 顯卡供應商:ATI 顯卡供應唯一ID:4098 顯卡版本號:Direct3D 11.0[level 11.0] 顯存大小MB:2026 顯卡是否支持多線程渲染:True 支持的渲染目標數量:83/ 在小米手機(安卓)里:(轉成string后打印)
設備模型:Xiaomi MI 5 設備名稱:<unknown> 設備類型(PC電腦,掌上型):Handheld 系統內存大小MB:2711 操作系統:Android OS 7.0/API-24(NRD90M/7.3.2) 設備唯一標識符:40d4637c25cad463cff9cb*************(一長串保密) 顯卡ID:0 顯卡名稱:Adreno(TM)530 顯卡類型:OpenGLES3 顯卡供應商:Qualcomm 顯卡供應唯一ID:0 顯卡版本號:OpenGL ES 3.2 V@145.0(GIT@lc27b94dfce) 顯存大小MB:1024 顯卡是否支持多線程渲染:False 支持的渲染目標數量:84/ 在蘋果手機(IOS)里:(轉成string后打印)
設備模型:iPhone6,2 設備名稱:鱷魚淚的iPhone 設備類型(PC電腦,掌上型):Handheld 系統內存大小MB:1000 操作系統:iPhone OS 9.3.3 設備唯一標識符:E6*************************(一長串保密) 顯卡ID:0 顯卡名稱:Apple A7 GPU 顯卡類型:Metal 顯卡供應商:Apple 顯卡供應唯一ID:0 顯卡版本號:Metal 顯存大小MB:256 顯卡是否支持多線程渲染:True 支持的渲染目標數量:4注:一般用到的就是這些,除此之外的,可以參考官方文檔。
總結
以上是生活随笔為你收集整理的SystemInfo获取系统参数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python画出送花表情图编程_pyth
- 下一篇: java信息管理系统总结_java实现科