我正在寻找一种使用以下方法获取用户的HWID:如何在C#中快速获取硬件ID?
但失败了。System.Management还没有完全移植到UnityEngine 4上,我需要找到一个替代方案,至少可以访问UnityEngine或其他东西。
有什么想法吗?
发布于 2016-12-17 20:43:06
使用SystemInfo.deviceUniqueIdentifier是为了统一而内置的。但是,要检查的一件事是,如果SystemInfo.unsupportedIdentifier运行在没有提供获得唯一id的方法的平台上,则可以返回它的值。
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
void Start () {
if (SystemInfo.unsupportedIdentifier != SystemInfo.deviceUniqueIdentifier)
{
// use SystemInfo.deviceUniqueIdentifier
}
}
}请确保您正在以在linux上有一个错误,没有返回一致的值。的形式运行Unity4.6.2或更高版本,但它在4.6.2中得到了修复。
https://stackoverflow.com/questions/41202709
复制相似问题