Version: 2021.1

SystemInfo.processorType

切换到手册
public static string processorType ;

描述

处理器名称(只读)。

在不支持该属性的平台上,将返回 SystemInfo.unsupportedIdentifier

using UnityEngine;
using System;
using System.Globalization;

public class Example : MonoBehaviour { void Start() { // Prints using the following format - "Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz" print(SystemInfo.processorType);

// Print out the architecture of the running process. // We can use the Environment property Is64BitProcess along with SystemInfo.processorType to figure it out. // Do a case insensitive string check. if (CultureInfo.InvariantCulture.CompareInfo.IndexOf(SystemInfo.processorType, "ARM", CompareOptions.IgnoreCase) >= 0) { if (Environment.Is64BitProcess) Debug.Log("ARM64"); else Debug.Log("ARM"); } else { // Must be in the x86 family. if (Environment.Is64BitProcess) Debug.Log("x86_64"); else Debug.Log("x86"); } } }

另请参阅:SystemInfo.processorCountSystemInfo.processorFrequency。在 2019.3 之前的 Android 上,此属性会返回进程架构而不是 CPU 名称。 若要确定正在运行的进程的架构,请参阅示例代码。

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961