获取设备信息——SystemInfo

作者:追风剑情 发布于:2016-1-25 14:45 分类:Unity3d

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


标签: Unity3d

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号