我想根据自己的版本(32位或64位)向我的应用程序添加更新功能。是否有一些功能我可以知道我的应用程序(从统一构建)是32位还是64位?
谢谢EveryOne!
答案 0 :(得分:3)
As"程序员"说...评估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