Search Issue Tracker
By Design
Votes
0
Found in
2019.4
2020.3
2021.2
2021.2.0f1c1
2022.1
Issue ID
1378131
Regression
No
Prefab modifications aren't saved when "Auto Save" is enabled
Reproduction steps:
1. Open the user's attached "EditGridTest.zip" project
2. Open the "SampleScene" Scene
3. Open the "Test" Prefab Asset
4. Check the "Auto Save" tick-box at the top of the Scene view
5. Click the "Edit Grid" button in the Inspector window inside of "TestGrid (Script)" Component
6. Left-click on the Scene view window to draw line blocks
7. Exit the "Test" Prefab Asset
8. Observe the Scene view window
Expected result: All drawn blocs are saved
Actual result: The minority of drawn blocks are saved
Reproducible with: 2019.4.33f1, 2020.3.24f1, 2021.2.5f1, 2022.1.0a16
Notes:
- Unchecking the "Auto Save" tick-box and saving the prefab manually doesn't reproduce the issue
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note:
In order to support drag-painting blocks you need to set the GUIUtility.hotcontrol property while painting (See https://docs.unity3d.com/ScriptReference/GUIUtility-hotControl.html).
The Prefab Mode checks if the hotcontrol is set and delays autosaving until it is released again.
Example for your editor script:
private void OnSceneGUI()
{
int controlID = GUIUtility.GetControlID(FocusType.Passive);
if (GUIUtility.hotControl == 0 && Event.current.type == EventType.MouseDown && Event.current.button == 0)
{
GUIUtility.hotControl = controlID;
Debug.Log("Grab hotcontrol");
}
if (GUIUtility.hotControl == controlID && Event.current.type == EventType.MouseUp && Event.current.button == 0)
{
GUIUtility.hotControl = 0;
Debug.Log("Release hotcontrol");
}
.....