Version: 2021.1
.NET profile support
Referencing additional class library assemblies

Stable scripting runtime: known limitations

Unity supports a modern .NET runtime. You may encounter the following issues when using the .NET runtime:

Code size

The stable scripting runtime comes with a larger .NET class library API than the legacy scripting runtime. This means the code size is frequently larger. This size increase may be significant, especially on size-constrained and Ahead-of-Time (AOT) platforms.

To mitigate code size increases:

  1. Choose the smallest .NET profile possible (see .NET profile support). The .NET Standard 2.0 profile is about half the size of the .NET 4.x profile, so use the .NET Standard 2.0 profile where possible.

  2. Enable Strip Engine Code in the Unity Editor Player settings (go to Edit > Project SettingsA broad collection of settings which allow you to configure how Physics, Audio, Networking, Graphics, Input and many other areas of your project behave. More info
    See in Glossary
    , then select the Player category). This option statically analyzes the managed code in the Project, and removes any unused code.

    Note: This option is only available with the 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
    scripting backendA framework that powers scripting in Unity. Unity supports three different scripting backends depending on target platform: Mono, .NET and IL2CPP. Universal Windows Platform, however, supports only two: .NET and IL2CPP. More info
    See in Glossary
    .


  • 2018–03–15 Page amended
.NET profile support
Referencing additional class library assemblies
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961