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
- Test Runner’s vertical scrollbar overlaps with the up and down arrows and upper toolbar tabs when the window is minimized
- The Input Field view is not updated when deleting lines of text
- The scrollbar does not respect empty lines in the Input Field
- “Texture Atlas Viewer“ button text overlaps another button when the UI Toolkit Debugger is narrowed
- Thresholds are no longer automatically calculated after deleting Motion fields in Blendtrees
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");
}
.....