SystemInfo类-Unity(转载)
来源:互联网 发布:windows多线程编程 编辑:程序博客网 时间:2024/06/06 20:10
原地址:http://www.cnblogs.com/Platform/p/5584207.html
作者:茫茫江浸月
SystemInfo类中的属性都是只读属性,存储着运行平台的一些信息,主要是显卡和设备信息,如:设备的名称、设备的类型、显卡的类型,显卡的名称、显卡供应商(制造商)、系统内存大小、显存大小、支持的渲染目标数量等等。
using UnityEngine;using System.Collections;using System.Collections.Generic;public class GameControllerScript: MonoBehaviour{ //指定输出文本框 public UnityEngine.UI.Text messageText; //存储临时字符串 System.Text.StringBuilder info = new System.Text.StringBuilder(); void Start() { //将输出文本框置空 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); //显卡设备标识ID GetMessage("显卡ID",SystemInfo.graphicsDeviceID.ToString()); //显卡名称 GetMessage("显卡名称", SystemInfo.graphicsDeviceName); //显卡类型 GetMessage("显卡类型",SystemInfo.graphicsDeviceType.ToString()); //显卡供应商 GetMessage("显卡供应商", SystemInfo.graphicsDeviceVendor); //显卡供应唯一ID GetMessage("显卡供应唯一ID", SystemInfo.graphicsDeviceVendorID.ToString()); //显卡版本号 GetMessage("显卡版本号",SystemInfo.graphicsDeviceVersion); //显卡内存大小 GetMessage("显存大小MB",SystemInfo.graphicsMemorySize.ToString()); //显卡是否支持多线程渲染 GetMessage("显卡是否支持多线程渲染",SystemInfo.graphicsMultiThreaded.ToString()); //支持的渲染目标数量 GetMessage("支持的渲染目标数量", SystemInfo.supportedRenderTargetCount.ToString()); //输出 messageText.text = info.ToString(); } void Update() { //退出 if (Input.GetKeyUp("escape")) { if (Input.GetKeyUp("escape")) { Application.Quit(); } } } void GetMessage(params string[] str) { if(str.Length==2) { info.AppendLine(str[0]+":"+str[1]); } } }
(1)在Unity3D编辑器中运行的结果:
(2)在Windows中的运行的结果:
(3)在Android中的运行的结果:
阅读全文
0 0
- SystemInfo类-Unity(转载)
- UNITY 5.2 SystemInfo类
- SystemInfo
- SystemInfo.deviceUniqueIdentifier
- UnityEngine.SystemInfo
- Unity-- 一些功能转载
- unity转载集合
- Unity-- 一些功能转载
- 转载Unity地形编辑
- 转载 Unity GameCenter 接入
- Unity生命周期(转载)
- 转载:unity坐标系详解
- Unity3D的SystemInfo类,用于获取运行设备硬件信息(CPU、显卡、类型等)
- 使用SYSTEMINFO类获取UNITY3D运行设备的各类信息(CPU类型,显卡类型等)
- Unity3D的SystemInfo类,用于获取运行设备硬件信息(CPU、显卡、类型等)
- 提权前的systeminfo命令
- 系统信息SystemInfo MemoryStatus
- day19/SystemInfo.java
- EOJ 3246 实验室传染病 线段树
- redisutil spring session 响应创建和摧毁
- java 方法参数-值调用,引用调用问题
- ML算法工程师的三个层次
- centos php7 安装mysqli扩展心得
- SystemInfo类-Unity(转载)
- gson解析泛型数据
- Kotlin学习笔记(四)-函数补充
- 自定义Dialog
- 《彼得堡里》——第一章(凭什么?)
- 【脚本语言系列】关于Python数据库处理SQLite,你需要知道的事
- C语言运算符及优先级
- redis缓存机制和底层实现
- 二叉平衡树代码实现