Defines how C# code in the project is compiled when exporting a build.
Each variant level is inclusive of the next level. For example, the Debug variant has Unity checks enabled, whereas the Checked variant has Instrumented code paths enabled. You can configure the managed code variant in a Unity project through the Player Settings or via PlayerSettings.GetManagedCodeVariant and PlayerSettings.SetManagedCodeVariant.
For more information on managed code variants, refer to Adding diagnostics to C# code.
| Property | Description |
|---|---|
| Debug | Compiles C# code without optimizations. Defines DEBUG and all the same defines as ManagedCodeVariant.Checked. Used for debugging the code with a debugger. |
| Checked | Compiles C# code with optimizations. Defines UNITY_ENABLE_CHECKS, UNITY_ASSERTIONS and all the same defines as ManagedCodeVariant.Instrumented. Used for running the game with extra checks enabled. |
| Instrumented | Compiles C# code with optimizations. Defines UNITY_INCLUDE_INSTRUMENTATION and ENABLE_PROFILER. Used for profiling. |
| Release | Compiles C# code with optimizations. Used for running with all unnecessary code paths disabled and for shipping releases to users. |