鸟语天空
获取设备信息——SystemInfo
post by:追风剑情 2016-1-25 14:45

using UnityEngine;
using System.Text;
using System.Collections;

public class SystemInfoTest : MonoBehaviour {

    void Start()
    {
        StringBuilder sb = new StringBuilder();
        sb.AppendLine("设备信息");
        sb.AppendLine("操作系统名称: " + SystemInfo.operatingSystem);
        sb.AppendLine("处理器名称: " + SystemInfo.processorType);
        sb.AppendLine("处理器数量: " + SystemInfo.processorCount);
        sb.AppendLine("当前系统内存大小: " + SystemInfo.systemMemorySize + "MB");
        sb.AppendLine("当前显存大小: " + SystemInfo.graphicsMemorySize + "MB");
        sb.AppendLine("显卡名字: " + SystemInfo.graphicsDeviceName);
        sb.AppendLine("显卡厂商: " + SystemInfo.graphicsDeviceVendor);
        sb.AppendLine("显卡的标识符代码: " + SystemInfo.graphicsDeviceID);
        sb.AppendLine("显卡厂商的标识符代码: " + SystemInfo.graphicsDeviceVendorID);
        sb.AppendLine("该显卡所支持的图形API版本: " + SystemInfo.graphicsDeviceVersion);
        sb.AppendLine("图形设备着色器性能级别: " + SystemInfo.graphicsShaderLevel);
        sb.AppendLine("显卡的近似像素填充率: " + SystemInfo.graphicsPixelFillrate);
        sb.AppendLine("是否支持内置阴影: " + SystemInfo.supportsShadows);
        sb.AppendLine("是否支持渲染纹理: " + SystemInfo.supportsRenderTextures);
        sb.AppendLine("是否支持图像效果: " + SystemInfo.supportsImageEffects);
        sb.AppendLine("设备唯一标识符: " + SystemInfo.deviceUniqueIdentifier);
        sb.AppendLine("用户定义的设备的名称: " + SystemInfo.deviceName);
        sb.AppendLine("设备的模型: " + SystemInfo.deviceModel);
        Debug.Log(sb.ToString());
	}
}

运行效果: Logcat打印日志

ssss1.png


评论:
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容