[UUM-136930] Fix Arch field not readable#674
Conversation
| if(comp is ProBuilderShape shapeComponent && shapeComponent.isEditable) | ||
| { | ||
| UndoUtility.RecordComponents<Transform, ProBuilderMesh, ProBuilderShape>(shapeComponent.GetComponents(typeof(Component)),"Resize Shape"); | ||
| Stopwatch stopWatch = new Stopwatch(); |
There was a problem hiding this comment.
It looks like some temporary diagnostic and profiling code (including Stopwatch instantiation, TimeSpan measurements, commented-out lines, and Debug.Log) was left in this block. To keep the codebase clean and avoid logging overhead, would you consider removing the performance-tracking logic and the commented-out lines?
For example, the block inside the if statement could be simplified to:
Undo.RegisterCompleteObjectUndo(shapeComponent.mesh, "Edit Shape");
shapeComponent.UpdateShape();
if(tool != null)
{
tool.SetBounds(shapeComponent.size);
tool.SaveShapeParams(shapeComponent);
}
ProBuilderEditor.Refresh();🤖 Helpful? 👍/👎 by guardian
| //Undo.RecordObject(shapeComponent.transform, "Edit Shape"); | ||
| //Undo.RecordObject(shapeComponent, "Edit Shape"); | ||
|
|
||
| Undo.RegisterCompleteObjectUndo(shapeComponent.mesh, "Edit Shape"); |
There was a problem hiding this comment.
It appears that WIP profiling and debugging code was accidentally committed here.
Commenting out UndoUtility.RecordComponents and replacing it with Undo.RegisterCompleteObjectUndo(shapeComponent.mesh, ...) skips registering Undo operations for Transform and ProBuilderShape changes. This will break Undo/Redo functionality when editing shape properties in the scene.
🤖 Helpful? 👍/👎 by bug_hunter
| stopWatch.Stop(); | ||
| // Get the elapsed time as a TimeSpan value. | ||
| TimeSpan ts3 = stopWatch.Elapsed; | ||
| Debug.Log($"Time spend = ({ts1.TotalMilliseconds}, {ts2.TotalMilliseconds}, {ts3.TotalMilliseconds}) ms"); |
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## master #674 +/- ##
==========================================
+ Coverage 36.05% 38.02% +1.96%
==========================================
Files 277 278 +1
Lines 34909 38859 +3950
==========================================
+ Hits 12588 14775 +2187
- Misses 22321 24084 +1763
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Purpose of this PR
This PR shorten the label "Arch circumference" to "Arch circ." to avoid a cut in the Editor UIs.
This choice has been done to align with the Torus shape that is already doing this.
Links
Jira: https://jira.unity3d.com/browse/UUM-136930
Comments to Reviewers
[List known issues, planned work, provide any extra context for your code.]