Version: 2018.3 (switch to 2019.1 )
Windows Runtime support
Optimizing IL2CPP build times
Other Versions

How IL2CPP works

Upon starting a build using IL2CPPA Unity-developed scripting back-end which you can use as an alternative to Mono when building Projects for some platforms. More info
See in Glossary
, Unity automatically performs the following steps:

  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.

A diagram of the automatic steps taken when building a project using IL2CPP
A diagram of the automatic steps taken when building a project using IL2CPP

IL2CPP provides a few useful options which you can control by attributes in your scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary
. See documentation on Platform-dependent compilation for further information.

对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答