gpt4 book ai didi

unity-game-engine - 如何知道Unity Build应用程序是32位还是64位

转载 作者:行者123 更新时间:2023-12-02 16:48:16 33 4
gpt4 key购买 nike

我想根据自己的版本(32位或64位)向我的应用程序添加更新功能。是否有一些函数可以让我知道我的应用程序(从 Unity 构建)是 32 位还是 64 位?

谢谢大家!

最佳答案

正如“程序员”所说...评估 IntPtr.Size 是正确的方法。以下是我们如何检测应用程序中当前 UI 版本的完整示例:

#if UNITY_EDITOR
this.uiType = "UNITY-EDITOR";
#elif UNITY_ANDROID
this.uiType = "UNITY-ANDROID";
#elif UNITY_IPHONE
this.uiType = "UNITY-IOS";
#elif UNITY_STANDALONE_LINUX
this.uiType = "UNITY-LINUX";
#elif UNITY_STANDALONE_OSX
this.uiType = "UNITY-MAC";
#elif UNITY_WEBGL
this.uiType = "UNITY-WEBGL";
#elif UNITY_STANDALONE_WIN
if (IntPtr.Size == 8)
this.uiType = "UNITY-WINDOWS64";
else
this.uiType = "UNITY-WINDOWS";
#else
Debug.LogError("Bad Version detected! (is this a new UI build?)");
#endif

关于unity-game-engine - 如何知道Unity Build应用程序是32位还是64位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39939785/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com