使用 IL2CPP 开始构建时,Unity 会自动执行以下步骤:
Compiles Unity Scripting API code to regular .NET DLLs (managed assemblies).
Applies managed bytecode stripping. This step significantly reduces the size of a built game.
Converts all managed assemblies to standard C++ code.
Compiles the generated C++ code and the runtime part of IL2CPP with a native platform compiler.
Links the code into either an executable file or a DLL, depending on the platform you are targeting.
IL2CPP 提供了一些有用的选项;可通过脚本中的属性来控制这些选项。请参阅有关平台相关的编译的文档以了解更多信息。