Search Issue Tracker
Won't Fix
Votes
11
Found in
2018.4
2019.4.3f1
2020.2
Issue ID
1262951
Regression
No
Platform #define directives & user defined directives are not updating when SwitchActiveBuildTarget() is used
How to reproduce:
1. Open the attached "UnitTestMacro.zip" project
2. In Menu Toolbar select "ManualBuild" -> Switch to UWP
3. In Hierarchy Window select "Camera" GameObject -> See the error in the Inspector Window
4. Click on "ManualBuild" -> select "Server Build"
5. Select "Camera" GameObject -> see the error in Inspector Window again
Expected result: The error no longer appears as the Build was switched back to Standalone
Actual result: The error still appears
Reproducible with: 2018.4.25f1, 2019.4.5f1, 2020.1.0f1, 2020.2.0a19
Notes:
- The issue does not appear when changing Build targets through the Build settings
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- The Scrollbar becomes unusable when adding Elements to the List
- "One or more data file missing for baking set NewScene Baking Set. Cannot load shared data." error in Player when a specific project is built
- Choosing new HDR Colour using RGB values breaks colour on Intensity Selectors
- Rendering/Decal Layer Mask options are different inside Prefab Mode and outside Prefab Mode when the project is upgraded to Unity 6
- Incorrect Realtime GI Light Probes baking when more than one Light Probe Group is used and "Baked Global Illumination" is enabled
Resolution Note:
SwitchActiveBuildTarget is async but build is synchronous, the editor wont have a chance to reload. AssemblyReloadEvents.afterAssemblyReload can be used to notify that the assembly load is completed before building.