Version: 2020.1
Scripting restrictions
Code reloading in the Unity Editor

Managed code stripping

Managed code stripping removes unused code from a build, which can significantly decrease the final build size. When using the IL2CPP scripting backend, managed code stripping can also decrease build time because less code needs to be converted to C++ and compiled. Managed code stripping removes code from managed assemblies, including assemblies built from the C# scripts in your Project, assemblies that are part of packages and plugins, and assemblies in the .NET frameworks.

Managed code stripping works by statically analyzing the code in a Project to detect classes, members of classes, and even portions of functions that can never be reached during execution. You can control how aggressive Unity prunes unreachable code with the Managed Stripping Level setting on the Player Settings window (in the Optimization section).

Important: When your code (or code in a plugin) looks up classes or members dynamically using reflection, the code stripping tool cannot always detect that the Project is using those classes or members, and might remove them. To declare that a Project is using such code, use