欢迎光临散文网 会员登陆 & 注册

unity读取电脑信息(SystemInfo)

2023-02-27 17:37 作者:星海三垣二十八宿  | 我要投稿

随便找了一台服务器的''虚拟机"测试

效果展示


代码如下

public TMP_Text A1;

public TMP_Text A27;(中间省略)

void Update()

{

        A1.text = "是否有可用于播放的音频设备?" + SystemInfo.supportsAudio;

        A2.text = "设备上是否有陀螺仪?" + SystemInfo.supportsGyroscope;

        A3.text = "检查当前配置是否支持光线追踪" + SystemInfo.supportsRayTracing;

        A4.text = "版本的操作系统名称" + SystemInfo.operatingSystem;

        A5.text = "应用程序实际渲染线程模式" + SystemInfo.renderingThreadingMode;

        A6.text = "是否有加速度计?" + SystemInfo.supportsAccelerometer;

        A7.text = "是否支持内置阴影?" + SystemInfo.supportsShadows;

        A8.text = "是否支持稀疏纹理?" + SystemInfo.supportsSparseTextures;

        A9.text = "系统内存容量" + SystemInfo.systemMemorySize;

        A10.text = "计算着色器可以在 Y 维度使用的最大工作组数" + SystemInfo.maxComputeWorkGroupSizeY;

        A11.text = "计算着色器可以在 Z 维度使用的最大工作组数" + SystemInfo.maxComputeWorkGroupSizeZ;

        A12.text = "计算着色器可以在 X 维度使用的最大工作组数" + SystemInfo.maxComputeWorkGroupSizeX;

        A13.text = "图形设备着色器功能级别" + SystemInfo.graphicsShaderLevel;

        A14.text = "图形设备是否使用多线程渲染?" + SystemInfo.graphicsMultiThreaded;

        A15.text = "具有的显存容量" + SystemInfo.graphicsMemorySize;

        A16.text = "图形设备使用的图形 API 类型和驱动程序版本" + SystemInfo.graphicsDeviceVersion;

        A17.text = "图形设备供应商的标识符代码" + SystemInfo.graphicsDeviceVendorID;

        A18.text = "图形设备的供应商" + SystemInfo.graphicsDeviceVendor;

        A19.text = "图形设备使用的图形 API 类型" + SystemInfo.graphicsDeviceType;

        A21.text = "用户定义的设备名称" + SystemInfo.deviceName;

        A22.text = "设备的型号" + SystemInfo.deviceModel;

        A23.text = "当前的电池电量" + SystemInfo.batteryLevel;

        A24.text = "处理器频率" + SystemInfo.processorFrequency;

        A25.text = "处理器数量" + SystemInfo.processorCount;

        A26.text = "处理器名称" + SystemInfo.processorType;

        A27.text = "图形设备的标识符代码" +StemInfo.graphicsDeviceID;

}

StemInfo可以读取关于计算机及其操作系统的详细配置信息

如果认为这样写麻烦,可以用C#中的换行符\n\r

\n(下一行开头位置)换行符

\r(回到一行开头)回车符


个人学习unity和C#的学习笔记 

unity读取电脑信息(SystemInfo)的评论 (共 条)

分享到微博请遵守国家法律