Search Issue Tracker
By Design
Votes
0
Found in
2018.3.0a6
2018.3.8f1
2019.1.0a1
2019.2.0a1
Issue ID
1136696
Regression
No
Custom brush is re-enabled when painting in Prefab mode with Auto Save on
How to reproduce:
1. Open the attached "case_1136696-CustomBrushPrefabMode" project
2. Select "GameObject1" in the Hierarchy and open it in Prefab Mode
3. Open the Tile Palette window and select "New Structure Brush" as the brush
4. Select "Segment tile" in the brush settings and try to paint in the tilemap
Expected results: Brush settings do not change after painting
Actual results: Brush settings get reset and OnEnable gets called on the brush script
Reproducible with: 2018.3.10f1, 2019.1.0b8, 2019.2.0a9
Note: When trying to reproduce in 2019.2 make sure to enable Tilemap Editor package
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
- UI Overlay Image gets darker on each Camera when multiple Cameras are used
- Assertion failed on expression: 'scriptedImporterClass == SCRIPTING_NULL error when opening the standalone profiler window
- Disabled assets in Import Unity Package window aren't tracked but count as being selected by user
- [Windows] Crash on GetManagerFromContext when video is playing and creating High Definition 3D Projects after FMOD failed to switch back to normal output Error appeared
- GC Alloc produced when adding items to MultiColumnListView with Auto Assign Binding
Resolution Note:
The reason why the brush settings do not persist after the Prefab is saved is because the toggle setting is stored in the StructureBrushEditor rather than the StructureBrush itself. Generally in Unity, the Editor acts as a helper to edit instances of the targets being edited and relies on the properties set in those instances rather than storing its own. The Editor is generally not persisted, after script reload or asset changes.
For this case, you could store the "toggles" data inside your StructureBrush rather than the StructureBrushEditor. This can be serialized and persisted in the asset then.