NEW: Icon to InputSystem settings asset#2400
NEW: Icon to InputSystem settings asset#2400josepmariapujol-unity wants to merge 10 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
The pull request introduces improvements to the Input System's editor settings, specifically regarding icon management. However, there are a few architectural and performance issues identified, such as setting icons in OnEnable (which can cause VCS noise) and potential icon persistence issues when creating new assets.
🤖 Helpful? 👍/👎
| private void OnEnable() | ||
| { | ||
| var icon = InputActionAssetIconLoader.LoadSettingsIcon(); | ||
| if (icon != null) | ||
| EditorGUIUtility.SetIconForObject(target, icon); | ||
| } |
There was a problem hiding this comment.
Calling EditorGUIUtility.SetIconForObject inside OnEnable of an Editor is an anti-pattern that can lead to several issues:
- Metadata Pollution: For assets, this method modifies the associated
.metafile. Calling it inOnEnableensures the metadata is potentially modified every time the asset is selected or the inspector is refreshed, causing unnecessary noise in Version Control Systems (e.g., Git, Perforce). - Dirtying Assets: It may mark the asset as dirty, triggering "Save Changes" prompts or automatic saves when the user merely viewed the asset.
- Import Loops: In some Unity versions, modifying metadata can trigger an asset re-import, which might re-trigger
OnEnable, potentially leading to a refresh loop.
It is recommended to set the icon once during asset creation or via an AssetPostprocessor rather than forcing it every time the inspector is enabled.
🤖 Helpful? 👍/👎
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## develop #2400 +/- ##
=========================================
Coverage 78.13% 78.13%
=========================================
Files 483 483
Lines 98770 98662 -108
=========================================
- Hits 77169 77089 -80
+ Misses 21601 21573 -28
|
|
FYI: I don't have capacity to test this yet, have 2 large PRs that need to be sorted first. Expecting to come back to this next week |
Description
Adding an icon to InputSystem settings asset
InputSystem.inputsettings.Icon library:

Dark:

Light:

Testing status & QA
N/A
Overall Product Risks
Please rate the potential complexity and halo effect from low to high for the reviewers. Note down potential risks to specific Editor branches if any.
Comments to reviewers
Please describe any additional information such as what to focus on, or historical info for the reviewers.
Checklist
Before review:
Changed,Fixed,Addedsections.Area_CanDoX,Area_CanDoX_EvenIfYIsTheCase,Area_WhenIDoX_AndYHappens_ThisIsTheResult.During merge:
NEW: ___.FIX: ___.DOCS: ___.CHANGE: ___.RELEASE: 1.1.0-preview.3.