Bootstrap

UnityAPI系统信息类SystemInfo

可以查看显卡信息,内存信息等系统信息

using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection.Emit;
using UnityEngine;

public class SystemInfoTest : MonoBehaviour
{
    private List<string> systemInfoList = new List<string>();
    private GUIStyle Style = new GUIStyle();

    void Start()
    {
        Style.fontSize = 30;
        Debug.LogError("Unity版本:" + Application.unityVersion);
        systemInfoList.Add("显卡:");
        systemInfoList.Add("显卡名称:" + SystemInfo.graphicsDeviceName);
        systemInfoList.Add("显卡标识符:" + SystemInfo.graphicsDeviceID);
        systemInfoList.Add("显卡类型:" + SystemInfo.graphicsDeviceType);
        systemInfoList.Add("显卡支持版本:" + SystemInfo.graphicsDeviceVersion);
        systemInfoList.Add("显存:" + SystemInfo.graphicsMemorySize);
        systemInfoList.Add("像素填充率:" + SystemInfo.graphicsPixelFillrate);
        systemInfoList.Add("显卡支持Shader层级:" + SystemInfo.graphicsShaderLevel);
        systemInfoList.Add("显卡是否支持多线程渲染:" + SystemInfo.graphicsMultiThreaded);

        systemInfoList.Add("--------");
        systemInfoList.Add("内存:" + SystemInfo.systemMemorySize);
        systemInfoList.Add("操作系统:" + SystemInfo.operatingSystem);
        systemInfoList.Add("CPU处理核数:" + SystemInfo.processorCount);
        systemInfoList.Add("CPU类型:" + SystemInfo.processorType);
        systemInfoList.Add("Unity版本:" + Application.unityVersion);
    }


    private void OnGUI()
    {
        for (int i = 0; i < systemInfoList.Count; i++)
        {
            GUI.Label(new Rect(10, (i + 1) * 50, 150, 100), systemInfoList[i], Style);
        }
    }
}

;