Search Issue Tracker
By Design
Votes
0
Found in
5.5.1p1
Issue ID
886618
Regression
No
Objects created in "if UNITY_EDITOR" make their way into the Build, if they are created in Awake of ExecuteInEditMode class
To reproduce:
1. Open "Example.zip" project.
2. Open "scene2".
3. Delete "Cube(Clone)" in Hierarchy, and save scene.
4. Build and Play project.
5. Cube still appears.
Expected result: Code which is executed in "if UNITY_EDITOR", should not have effect on the Build version.
Actual result: if a class is [ExecuteInEditMode], all objects created in it's Awake() function under the "if UNITY_EDITOR" appear in a build.
Reproducible with: 5.4.4p4, 5.5.2p1, 5.6.0b10, 2017.1.0a2
Workaround:
Change Awake() to Start().
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on when D3D12RenderPass::SetupDeviceResources when opening FBX animation preview
- Serialization errors are thrown when "com.unity.render-pipelines.core" is added as a custom package and Graphics window is opened
- Character Joints unexpectedly rotate when a ragdoll is created using the Ragdoll Wizard
- Crash on GfxDeviceD3D11Base::DrawBuffersBatchMode when rendering the Scene view
- The shared EditorBuildSettings.asset file of symlinked projects is not updated when changing the order of the Scenes in Build Settings in one of the projects
Add comment