Fix the renaming logic of copied meshes in MakeUnique function #644
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DO NOT FORGET TO INCLUDE A CHANGELOG ENTRY
Purpose of this PR
There is a problem in the newest release that:
GameObjectin a scene (e.g. Ctrl+C and Ctrl+V)Meshof the copied result will be like"pb_MeshXXX (Clone)""pb_MeshXXX (Clone)", we'll get"pb_MeshXXX (Clone) (Clone)", which is extremely uglyIt was because of the logic below from
MakeUniquefunction (It will only be called on the copied result when copy happens) in theProBuilderMeshFunction.cs, it doesn't handle the name of the copied GO'sMesh, so the GO will keep having aMeshnamed from the original GO with a '"(Clone)"' suffixThe
MakeUniquefunction was modified by Karl in the PR453, aiming at removing the dependencies on parsing the name ofMeshof a GO to get its InstanceID which will be used to check whether the GO is a copied result or modified result, PR453 also removed all the renaming logics ofMeshexcept the case when creatingMeshTherefore my PR is to fix the ugly naming of copied meshes
Links
Jira:
Comments to Reviewers
[List known issues, planned work, provide any extra context for your code.]