iOS 64 位支持是使用名为 IL2CPP 的脚本后端实现的。它与您的 C# 代码一起运行。
IL2CPP 运行时将提前编译器与虚拟机相结合,将程序集转换为 C++,同时利用标准平台 C++ 编译器生成本机二进制文件。最终结果是显著改善性能、平台兼容性和可维护性。
IL2CPP 是唯一支持在 iOS 上部署到 ARM 64 位的脚本后端,因此必须部署到 Apple App Store 以发布新应用程序。
如需了解有关 IL2CPP 的更多信息,请参阅博客文章:脚本技术在 Unity 中的未来发展 (The future of scripting in Unity) 和 Unity 中的 Apple iOS 64 位支持 (Apple iOS 64-bit support in Unity)。
在 Player 窗口上的 Scripting Backend 下拉菜单中选择 IL2CPP。
默认情况下,此脚本后端的构建目标为__通用 (Universal)__ 架构(包括 ARM64 和 _ARMv7_);如果需要,可以在 Player 窗口中切换到特定的架构。在应用程序启动并以 64 位运行之前,应执行大量操作:
Method not found: 'Default constructor not found...ctor() of System.ComponentModel.Int64Converter'
。
答:反序列化程序和序列化程序通常仅通过 .NET 反射 API 引用某些类型,在这种情况下,可能会从项目中剥离这些方法甚至类。您可以通过以下方式提示托管代码剥离器使用了特定类/方法:通过 link.xml 或通过引入在一个脚本中对其进行显式引用的虚拟代码。Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.