Merged
Conversation
Comment on lines
+196
to
+200
| #if UNITY_6000_3_OR_NEWER | ||
| string CanvasName => "_CM_canvas" + gameObject.GetEntityId(); | ||
| #else | ||
| string CanvasName => "_CM_canvas" + gameObject.GetInstanceID(); | ||
| #endif |
Contributor
There was a problem hiding this comment.
The CanvasName property performs string concatenation every time it is accessed. Since the ID of the gameObject remains constant during its lifetime, have you considered caching this string in a private field (e.g., initialized in Awake or lazily)? This would avoid unnecessary heap allocations if the property is accessed frequently during camera updates or UI refreshes.
🤖 Helpful? 👍/👎
glabute
approved these changes
Mar 16, 2026
windxu88
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose of this PR
Quick for remaining InstanceID API calls in 2.10.x
Testing status
[Explanation of what’s tested, how tested and existing or new automation tests. Can include manual testing by self and/or QA. Specify test plans. Rarely acceptable to have no testing.]
Documentation status
[Overview of how documentation is affected by this change. If there is no effect on documentation, explain why. Otherwise, state which sections are changed and why.]
Technical risk
[Overall product level assessment of risk of change. Need technical risk & halo effect.]
Comments to reviewers
[Info per person for what to focus on, or historical info to understand who have previously reviewed and coverage. Help them get context.]
Package version
[Justification for updating either the patch, minor, or major version according to the semantic versioning rules]