我一直在寻找一种方法来获取用户的HWID:How to fast get Hardware-ID in C#?
但失败了。 System.Management没有完全移植到UnityEngine 4上,我需要找到一个替代方案,以获得对CPUID等的访问权限。
有什么想法吗?
答案 0 :(得分:2)
使用SystemInfo.deviceUniqueIdentifier
内置于统一。但要检查的一件事是,如果SystemInfo.unsupportedIdentifier
运行在没有提供获取唯一ID的方法的平台上,它可以返回using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
void Start () {
if (SystemInfo.unsupportedIdentifier != SystemInfo.deviceUniqueIdentifier)
{
// use SystemInfo.deviceUniqueIdentifier
}
}
}
的值。
error_bad_lines=False
请确保您运行的是Unity 4.6.2或更新版本there was a bug for it on linux not returning consistent values但已在4.6.2中修复。