zoukankan      html  css  js  c++  java
  • SystemInfo获取设备系统参数

    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 initialization
    voidStart()
    {
    //将输出文本框置空
    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();
    }
    // Update is called once per frame
    voidUpdate()
    {
    //退出
    if(Input.GetKeyUp("escape"))
    {
    if(Input.GetKeyUp("escape"))
    {
    Application.Quit();
    }
    }
    }
    voidGetMessage(paramsstring[] str)
    {
    if(str.Length==2)
    {
    info.AppendLine(str[0]+":"+ str[1]);
    }
    }
    }
     





  • 相关阅读:
    macbook如何清理磁盘中的“容器中的其他宗卷”
    Maven本地仓库与远程仓库配置
    查看MySQL库、表所占磁盘空间大小
    数据库操作
    Mac Mysql初始密码重置
    Vue 性能优化经验总结
    【读书笔记】对象创建摘录
    【读书笔记】 函数柯里化
    js实现仿windows文件按名称排序
    本来想偷懒的今天,想了想,还是写一篇吧,前端登录界面,用的BOOTSTRAP
  • 原文地址:https://www.cnblogs.com/caymanlu/p/6023272.html
Copyright © 2011-2022 走看看