unity3d 獲取系統硬體資訊
阿新 • • 發佈:2019-02-07
using UnityEngine; using System.Collections; /// <summary> /// 獲取當前裝置資訊 /// </summary> public class GetSystemInfo : MonoBehaviour { string systemInfo; // Use this for initialization void Start() { systemInfo = "\tTitle:當前系統基礎資訊:\n裝置模型:" + SystemInfo.deviceModel + "\n裝置名稱:" + SystemInfo.deviceName + "\n裝置型別:" + SystemInfo.deviceType + "\n裝置唯一識別符號:" + SystemInfo.deviceUniqueIdentifier + "\n顯示卡識別符號:" + SystemInfo.graphicsDeviceID + "\n顯示卡裝置名稱:" + SystemInfo.graphicsDeviceName + "\n顯示卡廠商:" + SystemInfo.graphicsDeviceVendor + "\n顯示卡廠商ID:" + SystemInfo.graphicsDeviceVendorID + "\n顯示卡支援版本:" + SystemInfo.graphicsDeviceVersion + "\n視訊記憶體(M):" + SystemInfo.graphicsMemorySize + "\n顯示卡畫素填充率(百萬畫素/秒),-1未知填充率:" + SystemInfo.graphicsPixelFillrate + "\n顯示卡支援Shader層級:" + SystemInfo.graphicsShaderLevel + "\n支援最大圖片尺寸:" + SystemInfo.maxTextureSize + "\nnpotSupport:" + SystemInfo.npotSupport + "\n作業系統:" + SystemInfo.operatingSystem + "\nCPU處理核數:" + SystemInfo.processorCount + "\nCPU型別:" + SystemInfo.processorType + "\nsupportedRenderTargetCount:" + SystemInfo.supportedRenderTargetCount + "\nsupports3DTextures:" + SystemInfo.supports3DTextures + "\nsupportsAccelerometer:" + SystemInfo.supportsAccelerometer + "\nsupportsComputeShaders:" + SystemInfo.supportsComputeShaders + "\nsupportsGyroscope:" + SystemInfo.supportsGyroscope + "\nsupportsImageEffects:" + SystemInfo.supportsImageEffects + "\nsupportsInstancing:" + SystemInfo.supportsInstancing + "\nsupportsLocationService:" + SystemInfo.supportsLocationService + "\nsupportsRenderTextures:" + SystemInfo.supportsRenderTextures + "\nsupportsRenderToCubemap:" + SystemInfo.supportsRenderToCubemap + "\nsupportsShadows:" + SystemInfo.supportsShadows + "\nsupportsSparseTextures:" + SystemInfo.supportsSparseTextures + "\nsupportsStencil:" + SystemInfo.supportsStencil + "\nsupportsVertexPrograms:" + SystemInfo.supportsVertexPrograms + "\nsupportsVibration:" + SystemInfo.supportsVibration + "\n記憶體大小:" + SystemInfo.systemMemorySize; } // Update is called once per frame void OnGUI() { GUILayout.Label(systemInfo); } }