Unity Issue Tracker - ENABLE_MONO and ENABLE_IL2CPP directives are incorrectly defined when entering Play mode
Closed
UUM-48934
ENABLE_MONO and ENABLE_IL2CPP directives are incorrectly defined when entering Play mode
Unity: Scripting Buildtime
As Designed
2023.3.X
2023.2.X
2023.1.X
2022.3.X
2021.3.X
`ENABLE_IL2CPP` are only set if the current running scripting backend are IL2CPP. Playmode always runs Mono.
`ENABLE_IL2CPP` will only be for player builds with the il2cpp scripting backend selected.
Reproduction steps:
1. Open project “Test_IL2CPP_Conditional_Compilation.zip”
2. Open “SampleScene”
3. Make sure the IL2CPP scripting backend is set in the Project Settings
4. Enter Play mode
Expected result: The editor exits play mode and prints a "IL2CPP scripting backend is enabled." log message in the Console
Actual result: The editor exits play mode and prints a "Mono scripting backend is enabled." log message in the Console