SystemInfo获取设备系统参数

来源:互联网 发布:微赞是什么样的软件 编辑:程序博客网 时间:2024/06/05 14:26
using UnityEngine;using System.Collections;using System.Collections.Generic;publicclassGameControllerScript:MonoBehaviour{//指定输出文本框publicUnityEngine.UI.Text messageText;//存储临时字符串System.Text.StringBuilder info =newSystem.Text.StringBuilder();// Use this for initializationvoidStart(){//将输出文本框置空messageText.text ="";info.AppendLine("设备与系统信息:");//设备的模型GetMessage("设备模型",SystemInfo.deviceModel);//设备的名称GetMessage("设备名称",SystemInfo.deviceName);//设备的类型GetMessage("设备类型(PC电脑,掌上型)",SystemInfo.deviceType.ToString());//系统内存大小GetMessage("系统内存大小MB",SystemInfo.systemMemorySize.ToString());//操作系统GetMessage("操作系统",SystemInfo.operatingSystem);//设备的唯一标识符GetMessage("设备唯一标识符",SystemInfo.deviceUniqueIdentifier);//显卡设备标识IDGetMessage("显卡ID",SystemInfo.graphicsDeviceID.ToString());//显卡名称GetMessage("显卡名称",SystemInfo.graphicsDeviceName);//显卡类型GetMessage("显卡类型",SystemInfo.graphicsDeviceType.ToString());//显卡供应商GetMessage("显卡供应商",SystemInfo.graphicsDeviceVendor);//显卡供应唯一IDGetMessage("显卡供应唯一ID",SystemInfo.graphicsDeviceVendorID.ToString());//显卡版本号GetMessage("显卡版本号",SystemInfo.graphicsDeviceVersion);//显卡内存大小GetMessage("显存大小MB",SystemInfo.graphicsMemorySize.ToString());//显卡是否支持多线程渲染GetMessage("显卡是否支持多线程渲染",SystemInfo.graphicsMultiThreaded.ToString());//支持的渲染目标数量GetMessage("支持的渲染目标数量",SystemInfo.supportedRenderTargetCount.ToString());//输出messageText.text = info.ToString();}// Update is called once per framevoidUpdate(){//退出if(Input.GetKeyUp("escape")){if(Input.GetKeyUp("escape")){Application.Quit();}}}voidGetMessage(paramsstring[] str){if(str.Length==2){info.AppendLine(str[0]+":"+ str[1]);}}}

转自https://www.cnblogs.com/caymanlu/p/6023272.html


原创粉丝点击