Search Issue Tracker
By Design
Votes
0
Found in
2019.3
2019.3.0f6
2020.1
Issue ID
1215741
Regression
No
Modifications to textures with AssetDatabase.ForceReserializeAssets() reset upon restarting Editor when using Asset Database v2
How to reproduce:
1. Open the project from the attached file "1215741.zip"
2. Expand the TestSquare.png file in the Assets folder
3. Right-click on the TestSquare sprite(the file that appears after expanding)
4. From the dropdown, select "Modify UV"
5. Close and re-open the same project
6. Inspect the Scene View
Expected result: The sprite looks the same as before closing the project
Actual result: Sprite has returned to its initial value
Reproducible with: 2019.3.0f6, 2020.1.0a23
Could not test with: 2017.4.37f1, 2018.4.17f1, 2019.3.0a1(Asset Database v2 not introduced)
Note: Texture Type of the texture has to be set to Sprite(2D and UI)
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
- Character spacing value is not applied when using a specific font asset
- [Android][IL2CPP] Player crashes on __memcpy_aarch64_simd+276 when invoking native code via a plugin on some ARM64 Android devices
- [Android]Resources fail to load when the AAB build contains a large Addressables Bundle
- Unity is loading internal version of SharpZipLib instead of local version
- The Context Menu items are ordered incorrectly
Resolution Note:
Sprite is and imported asset from texture file. It is generated and immutable. Modifying it by script will work for as long as asset is not reimported again or library is not deleted. Changing ADB versions make this "bug" appear just because we reimport all assets. Script made changes to sprite would disappear as well after manual reimport was triggered via context menu item.
For such use cases AssetPostprocessor.OnPostprocessTexture or OnPostProcessAllAssets should be used. (preferably first one). More information here: https://docs.unity3d.com/ScriptReference/AssetPostprocessor.OnPostprocessTexture.html