Search Issue Tracker
By Design
Votes
10
Found in
2020.2.0a16
2020.2.0a17
Issue ID
1262293
Regression
No
Editor throws warning when adding a Scriptable Object as a sub asset using AssetDatabase.AddObjectToAsset
How to reproduce:
1. Open attached project "case1262293.zip"
2. Select "MainAsset" in the Project window
3. Click the "Add" button in the Inspector window
4. Observe the warning in the Console window
Expected: No warnings in the Console window
Actual: Warning "Importer(NativeFormatImporter) generated inconsistent result" is thrown in the Console window
Reproducible with: 2020.2.0a16, 2020.2.0a18
Not reproducible with: 2018.4.25f1, 2019.4.4f1, 2020.1.0b16, 2020.2.0a15
-
NikoBay
Nov 18, 2021 08:25
Using AssetDatabase.AddObjectToAsset() does not solve the problem and even creates more error:
"The asset at Assets/***.asset has been scheduled for reimport during the Refresh loop and Loading of it has been attempted.
Doing this can lead to the AssetDatabase returning two versions of the same asset...."
How can we open this issue again? -
onembitshorde
Nov 13, 2020 23:57
This is actually happening to me in 2020.2.0b11. Mostly with Scriptable Objects and by reference.
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
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
- [RenderingDebugger][InputSystemPackage] Ctrl+Backspace shortcut doesn't work to open the Rendering Debugger when New Input System is in use
Resolution Note:
Although the warning is new, it is correctly flagging an issue.
When using AssetDatabase.AddObjectToAsset(), the changes in memory must be saved to disk using AssetDatabase.SaveAssets() . Failure to do this causes the inconsistent result warning, because the in-memory changes are not synchronised with the asset on disk.
The documentation is being updated to explicitly call this out.