To build your project using IL2CPP, open the Build Settings window (File > Build Settings). Select the platform you are building for, then click Player Settings to open the Player settings in the Inspector.
In the Project Settings window, locate the Player settings for your target platform, and scroll down to the Configuration section. For Scripting Backend, select IL2CPP.
在 Scripting Backend 中选择 IL2CPP 后,单击 Build Settings 窗口中的 Build。Unity 开始将 C# 代码和程序集转换为 C++,然后为目标平台生成二进制文件。