Search Issue Tracker
By Design
Votes
0
Found in
2018.4.33f1
2019.3.0f5
2020.3
2021.1
2021.2
Issue ID
1328553
Regression
Yes
Nested asset name will not update in Project View if renamed from a script
How to reproduce:
1. Open the attached project
2. Select TestAsset in the Project View
3. In the Inspector type in a new name at Nested Asset Name
4. Click Rename Nested Asset to
5. Observe Project View
Expected result: The nested asset is renamed in Project View
Actual result: The nested asset is not renamed in Project View
Reproducible with: 2019.3.0f5, 2019.4.23f1, 2020.3.4f1, 2021.1.3f1, 2021.2.0a13
Not reproducible with:2018.4.33f1, 2019.3.0f4
Could not test with:
Notes:
1. 2020.3, 2021.1, 2021.2 streams update Project View but throw a console warning
2. The asset will not get renamed in Project View in 2020.3.4f1 about 1/50 times
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
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Resolution Note (2021.2.X):
The WeaponEditor.Rename() method in the repro isn't doing rename correct.
1) It is modifying the name of the main asset - not the nested asset object
2) Modifying an native asset in memory and calling ImportAsset, isn't the right way to save asset object memory changes. AssetDatabase.SaveAssets() should be called instead.
This implementation of the Rename() method works:
private void Rename()
{
serializedObject.targetObject.name = effectName;
AssetDatabase.SaveAssets();
}