Version: Unity 6.6 Alpha (6000.6)
LanguageEnglish
  • C#

ManagedCodeVariant

enumeration

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

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.

Properties

Property Description
DebugCompiles C# code without optimizations. Defines DEBUG and all the same defines as ManagedCodeVariant.Checked. Used for debugging the code with a debugger.
CheckedCompiles 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.
InstrumentedCompiles C# code with optimizations. Defines UNITY_INCLUDE_INSTRUMENTATION and ENABLE_PROFILER. Used for profiling.
ReleaseCompiles C# code with optimizations. Used for running with all unnecessary code paths disabled and for shipping releases to users.