Search Issue Tracker
By Design
Votes
0
Found in
2020.3
2021.2
2021.2.1f1
2022.1
Issue ID
1385293
Regression
No
Accelerator Returns Incorrect Data when Asset is imported using Custom Importer
Reproduction steps:
1. Set up accelerator for this project
2. Open the attached project "repro.zip"
3. Create an empty file "a.artmat" in "Assets/test" folder in Windows Explorer
4. Bring Editor to focus
5. Change 11th line of "Assets/test/Editor/TestImporter.cs" to "TextAsset ta = new TextAsset("7");"
6. Reimport "Assets/test/a.artmat"
7. Move "Assets/test/a.artmat" and "Assets/test/a.artmat.meta" files to the project folder in Windows Explorer
8. Reload the project
9. Move "a.artmat" and "a.artmat.meta" files to the "Assets/test" folder in Windows Explorer
10. Select "Assets/test/a.artmat"
Expected result: "Assets/test/a.artmat" contents are: "7"
Actual result: "Assets/test/a.artmat" contents are: "1"
Reproducible with: 2020.3.24f1, 2021.2.5f1, 2022.1.0b1
Could not test with: 2019.4.33f1 (Could not downgrade the project)
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
- Getting a deprecated package for JetBrains Rider pop up when opening or creating a project
- [Android] Volume level of the same audio file is different on Samsung Galaxy Tab A8 between 2023.3.0b3 and 2023.3.0b4
- ‘Expected end of value’ warning occurs when a property declaration includes five or more variable references
- Crash on BurstCompilerService::CompileAsync when entering Play mode in a specific scene
- InvalidOperationException when using Game Camera Preview in Scene window with a custom RenderGraph pass
Resolution Note (2022.2.X):
This is actually as designed. We don't do a hash of the source for dependency tracking, as it's not trivial to generate because it can depend on code from anywhere.
Instead what users should do is increment the version number of the scripted importer. See https://docs.unity3d.com/2020.1/Documentation/ScriptReference/Experimental.AssetImporters.ScriptedImporterAttribute.html for more information on the Scripted importer attributes, including the "version".
We have had chats in the past about generating a hint for users saying something "We've detected a possible change in the importer version. Consider incrementing it.". But this isn't on the roadmap, so therefore not something we'll be looking at anytime soon.