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
- UnityLinker causes crash when outputting snapshot data for very large projects
- Camera Preview does not detect multiple cameras with same GameObject name
- Crash on TypeTreeIterator::Children() when renaming a corrupted asset while Asset Serialization is set to Mixed
- Cameras (Camera.targetDisplay) render only to Display 0 in the Player when Multi-Display setup is used and DX12 API is set
- [Vulkan] _CameraOpaqueTexture produces a feedback effect on Android Adreno devices when using Vulkan
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");
}
.....