如何获得与UnityEngine.SystemInfo.deviceUniqueIdentifier中相同的硬件ID?

时间:2019-04-23 10:32:40

标签: c# unity3d

我想在Windows窗体应用程序中获得与在游戏中使用.slick-prev, .slick-next { z-index: 1000; } 时得到的相同的硬件ID。

如何获得相同的硬件ID?

3 个答案:

答案 0 :(得分:1)

我知道我迟到了,但 Unity 的 SystemInfo::deviceUniqueIdentifier 是这样构建的:

需要:select p.id, nvl( min(b.box_size) keep (dense_rank first order by decode(b.box_size, 'S', 1, 'M', 2, 'L', 3)) , 'not available') as box_size from products p left outer join boxes b on p.h <= b.h and least (p.w, p.d) <= least (b.w, b.d) and greatest(p.w, p.d) <= greatest(b.w, b.d) or p.layable = 'y' and ( p.w <= b.h and least (p.h, p.d) <= least (b.w, b.d) and greatest(p.h, p.d) <= greatest(b.w, b.d) or p.d <= b.h and least (p.w, p.h) <= least (b.w, b.d) and greatest(p.w, p.h) <= greatest(b.w, b.d) ) group by p.id ; ID BOX_SIZE --- -------- a S b M c L d S e L f L g S h M i L j not available 中的 using System.Management; (.NET Framework)

System.Management.dll

我对 Unity 编辑器进行了逆向工程,以找出它在 WMI 中实际查询的内容。 这显然是 Windows 实现。

答案 1 :(得分:0)

https://docs.unity3d.com/ScriptReference/SystemInfo-deviceUniqueIdentifier.html

SystemInfo.deviceUniqueIdentifier
Leave feedback
public static string deviceUniqueIdentifier;
Description
A unique device identifier. It is guaranteed to be unique for every device (Read Only).

iOS: on pre-iOS7 devices it will return hash of MAC address. On iOS7 devices it will be UIDevice identifierForVendor or, if that fails for any reason, ASIdentifierManager advertisingIdentifier.

Android: SystemInfo.deviceUniqueIdentifier always returns the md5 of ANDROID_ID. (See https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID). Note that since Android 8.0 (API level 26) ANDROID_ID depends on the app signing key. That means "unsigned" builds (which are by default signed with a debug keystore) will have a different value than signed builds (which are signed with a key provided in the player settings). Also when allowing Google Play to sign your app, this value will be different when testing locally built app which is signed with the upload key and app downloaded from the Google Play which will be signed with the "final" key.

Windows Store Apps: uses AdvertisingManager::AdvertisingId for returning unique device identifier, if option in 'PC Settings -> Privacy -> Let apps use my advertising ID for experiences across apps (turning this off will reset your ID)' is disabled, Unity will fallback to HardwareIdentification::GetPackageSpecificToken().Id.

Windows Standalone: returns a hash from the concatenation of strings taken from Computer System Hardware Classes (https://msdn.microsoft.com/en-us/library/windows/desktop/aa389273(v=vs.85).aspx):
Win32_BaseBoard::SerialNumber
Win32_BIOS::SerialNumber
Win32_Processor::UniqueId
Win32_DiskDrive::SerialNumber
Win32_OperatingSystem::SerialNumber

答案 2 :(得分:-2)

我想知道如何在UnityEngine之外复制它。