Search Issue Tracker
By Design
Votes
0
Found in
2019.3
2019.3.10f1
2019.4
2020.1
2020.2
Issue ID
1256326
Regression
No
Code in UNITY_EDITOR block executes during Player or Assetbundle build
Steps to reproduce:
1. Open user's attached project "UnityEditorWhenAssetbundling.zip"
2. Go to Build Settings
3. Build
4. Launch the build
Expected results: An empty scene will be opened in build
Actual results: A pink cube is displayed in the scene
Reproducible with: 2019.4.0f1, 2020.1.0b14, 2020.2.0a15
Unable to test with: 2018.4.23f1(project breaking)
Note: "Build and Run" fails the build
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
- SystemInfo.get_graphicsDeviceName() is generating garbage GC Alloc when using Metal graphics API
- Crash on D3D12CommonShader::ApplyGpuProgram when attaching material which samples "_UnityFBInput0" to "Full Screen Pass Renderer Feature" Component
- SpeedTree meshes and objects count differs when comparing the numbers in the Player with the Editor
- Model and Prefab Preview icons are not updated after upgrading associated Materials to URP
- Game view is rendered white when viewing the Editor with HDR display and Post Proccesing is enabled on the Main Camera with 2D URP
Resolution Note:
The code within "UNITY_EDITOR" block is only executed in the editor, but it creates scene objects that are actually serialized and that are then part of the game.
This is the intended behaviour.