SystemInfo.processorType
Declaration
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.processorCount, SystemInfo.processorFrequency. На Android до 2019.3 это свойство возвращает архитектуру процесса, а не имя CPU. Для определения архитектуры запущенного процесса см. примерный код.