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
- The Up, Down and other Buttons in a Style Sheet's Inspector unselect items when they are clicked while they are disabled
- Virtual Player remains active and still launches when removed from Additional Editor Instances from a custom Play Mode Scenario
- UI Toolkit Editor Window Creator becomes not interactable and greyed out when a long name is entered
- [Web][iOS] Web Player keeps restarting on launch when Native C/C++ Multithreading is enabled
- "Add Scene to Scenes in Build" pop-up reappears after Scene has already been added and another Multiplayer Editor Instance is loaded
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();
}