Defines how C# code in the project is compiled when exporting a build.
Each variant level is inclusive of the next level: for instance, the Debug variant has Unity checks enabled, whereas the Checked variant has Instrumented code paths enabled. Managed code variant can be configured in a Unity project through Player Settings or via PlayerSettings.GetManagedCodeVariant and PlayerSettings.SetManagedCodeVariant.
| 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. |