Steps to reproduce:
- Open a Unity Project
- Import TextMeshPro Essential Resources via Window > TextMeshPro > Import TMP Essential Resources
- Import TextMeshPro Examples & Extras via Window > TextMeshPro > Import TMP Examples and Extras
- Create a Text (TMP) GameObject via GameObject > UI > Text - TextMeshPro
- Select the new Text (TMP) Object
- In the Text Input section on the TextMeshPro - Text component, add the below text:
<font="Anton SDF" material="Anton SDF - Drop Shadow">Test</font>
- A SubMesh GameObject should be automatically created as a child object of the Text (TMP) Object
- Try to delete this SubMesh GameObject by either selecting it and clicking the delete key, or right-clicking on it and clicking delete
- Observe that it doesn't delete. This is expected as the font is still being used in a rich text tag
- Press ctrl + z to undo
Actual results: A duplicate of the SubMesh is created in the Hierarchy, and the warning 'Child GameObject 'TMP SubMeshUI [Anton SDF - Drop Shadow]' was not registered into undo system and became dangling during an undo operation.' is logged to the console
Expected results: A duplicate of the SubMesh is not created, and there is no warning logged to console.
Reproducible with versions: 7000.0.0a11, 6000.1.0a8, 6000.0.30f1, 2022.3.54f1, 2021.3.45f1
Not reproducible with versions: -
Can't test with versions:
Tested on (OS): Windows 11
Notes:
- In 2021.3 there is no warning when undoing, but the SubMesh still doubles up. In all later versions the warning occurs