Windows 运行时支持
优化 IL2CPP 构建时间

IL2CPP 的工作原理

使用 IL2CPP 开始构建时,Unity 会自动执行以下步骤:

  1. Compiles Unity Scripting API code to regular .NET DLLs (managed assemblies).

  2. Applies managed bytecode stripping. This step significantly reduces the size of a built game.

  3. Converts all managed assemblies to standard C++ code.

  4. Compiles the generated C++ code and the runtime part of IL2CPP with a native platform compiler.

  5. Links the code into either an executable file or a DLL, depending on the platform you are targeting.

使用 IL2CPP 构建项目时所采取的自动步骤的图表
使用 IL2CPP 构建项目时所采取的自动步骤的图表

IL2CPP 提供了一些有用的选项;可通过脚本中的属性来控制这些选项。请参阅有关平台相关的编译的文档以了解更多信息。

Windows 运行时支持
优化 IL2CPP 构建时间