Skip to content

Comments

CHANGE: Revert: Deprecate useIMGUIEditorForAssets #2283#2347

Merged
josepmariapujol-unity merged 2 commits intodevelopfrom
input/uum-133864/serialize
Feb 18, 2026
Merged

CHANGE: Revert: Deprecate useIMGUIEditorForAssets #2283#2347
josepmariapujol-unity merged 2 commits intodevelopfrom
input/uum-133864/serialize

Conversation

@josepmariapujol-unity
Copy link
Collaborator

@josepmariapujol-unity josepmariapujol-unity commented Feb 17, 2026

Description

Reverting: CHANGE: Deprecate useIMGUIEditorForAssets #2283

This PR fixes the regression introduced by the PR above since it does not serialize Interactions and Processors.

JIRA: UUM-133864

Before:
Screenshot 2026-02-17 at 13 23 12

After:
Screenshot 2026-02-17 at 13 15 27

Testing status & QA

Make a monobehaviour script and Serialize InputActions. Add Interactions and Processors as shown above.

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.

  • Complexity:
  • Halo Effect:

Comments to reviewers

Please describe any additional information such as what to focus on, or historical info for the reviewers.

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

@josepmariapujol-unity josepmariapujol-unity self-assigned this Feb 17, 2026
@josepmariapujol-unity josepmariapujol-unity marked this pull request as ready for review February 17, 2026 12:06
@u-pr
Copy link
Contributor

u-pr bot commented Feb 17, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪

The PR involves restoring code across multiple editor files; while the changes are straightforward (mostly reverting deletions), verifying the logic consistency, especially the hybrid IMGUI/UIToolkit interactions and the restored feature flags, requires moderate attention.
🏅 Score: 92

The code correctly reverts the deprecation, restoring tests, analytics, and editor functionality with proper safeguards. The changes are consistent and cover the necessary scope.
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Fragile Logic

The property useIMGUIEditorForAssets uses UnityEditor.EditorGUI.indentLevel > 0 as a heuristic to detect if the code is running in the Inspector. This logic could be fragile if an Inspector (or a custom window relying on this) draws root properties with an indentation of 0, potentially causing the restored IMGUI controls to be skipped.

public bool useIMGUIEditorForAssets => UnityEditor.EditorGUI.indentLevel > 0 || IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets);
Possible Missing Member

The restored OnGUI method references m_ScaleFactorLabel, but the diff does not show this field being added back to the class. If this field was removed in the original PR that is being reverted, this code will fail to compile.

target.scaleFactor = EditorGUILayout.Slider(m_ScaleFactorLabel, currentValue, 0, 2);
  • Update review

🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr

@u-pr
Copy link
Contributor

u-pr bot commented Feb 17, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix invalid arguments in HelpBox call

EditorGUILayout.HelpBox does not accept a GUIContent object as the first argument,
and it requires a MessageType as the second argument. Use .text from the content and
specify the message type (e.g., MessageType.None or MessageType.Info).

Packages/com.unity.inputsystem/InputSystem/Actions/Interactions/PressInteraction.cs [214-222]

 public override void OnGUI()
 {
     if (!InputSystem.settings.useIMGUIEditorForAssets)
         return;
 
-    EditorGUILayout.HelpBox(s_HelpBoxText);
+    EditorGUILayout.HelpBox(s_HelpBoxText.text, MessageType.None);
     target.behavior = (PressBehavior)EditorGUILayout.EnumPopup(s_PressBehaviorLabel, target.behavior);
     m_PressPointSetting.OnGUI();
 }
Suggestion importance[1-10]: 10

__

Why: The call to EditorGUILayout.HelpBox uses incorrect arguments (passing a GUIContent object instead of a string and missing the required MessageType parameter), which will cause a compilation error.

High
Avoid referencing UnityEditor in runtime scripts

Referencing UnityEditor.EditorGUI inside a runtime class (InputSettings) will cause
compilation errors if the runtime assembly definition does not reference the
UnityEditor assembly (which it typically shouldn't). Additionally, relying on
indentLevel is fragile as it couples the setting to the immediate GUI state.
Consider moving this logic to an Editor-only utility or removing the indentLevel
check.

Packages/com.unity.inputsystem/InputSystem/InputSettings.cs [961-970]

 #if UNITY_EDITOR
         /// <summary>
         /// Determines if we should render the UI with IMGUI even if an UI Toolkit UI is available.
-        ///
-        /// This should be used when writing a custom <see cref="InputParameterEditor"/> to :
-        /// * support inspector view which only work in IMGUI for now.
-        /// * prevent the UI to be rendered in IMGUI and UI Toolkit in the Input Actions Editor window.
+        /// ...
         /// </summary>
-        public bool useIMGUIEditorForAssets => UnityEditor.EditorGUI.indentLevel > 0 || IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets);
+        public bool useIMGUIEditorForAssets => IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets);
 #endif
Suggestion importance[1-10]: 9

__

Why: Referencing the UnityEditor namespace in a runtime script (like InputSettings) will typically cause compilation errors in the Editor if the runtime assembly definition does not reference the Editor assembly (which it should not). Additionally, using EditorGUI.indentLevel as a heuristic for UI context is fragile.

High
  • More suggestions

🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr

@codecov-fd.fxlcf.dpdns.org
Copy link

codecov-fd.fxlcf.dpdns.org bot commented Feb 17, 2026

Codecov Report

Attention: Patch coverage is 10.74380% with 108 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...nputSystem/Editor/AssetEditor/ParameterListView.cs 11.47% 54 Missing ⚠️
...putSystem/Actions/Interactions/PressInteraction.cs 0.00% 9 Missing ⚠️
...System/Actions/Interactions/MultiTapInteraction.cs 0.00% 8 Missing ⚠️
...em/InputSystem/Actions/Composites/AxisComposite.cs 0.00% 5 Missing ⚠️
...InputSystem/Actions/Composites/Vector2Composite.cs 0.00% 5 Missing ⚠️
...InputSystem/Actions/Composites/Vector3Composite.cs 0.00% 5 Missing ⚠️
...nputSystem/Actions/Interactions/HoldInteraction.cs 0.00% 4 Missing ⚠️
...tSystem/Actions/Interactions/SlowTapInteraction.cs 0.00% 4 Missing ⚠️
...InputSystem/Actions/Interactions/TapInteraction.cs 0.00% 4 Missing ⚠️
...ystem/Controls/Processors/AxisDeadzoneProcessor.cs 0.00% 4 Missing ⚠️
... and 2 more
@@             Coverage Diff             @@
##           develop    #2347      +/-   ##
===========================================
- Coverage    77.95%   77.89%   -0.07%     
===========================================
  Files          476      476              
  Lines        97453    97613     +160     
===========================================
+ Hits         75971    76036      +65     
- Misses       21482    21577      +95     
Flag Coverage Δ
inputsystem_MacOS_2022.3 5.53% <0.00%> (-0.02%) ⬇️
inputsystem_MacOS_2022.3_project 75.39% <3.30%> (-0.08%) ⬇️
inputsystem_MacOS_6000.0 5.30% <0.00%> (-0.02%) ⬇️
inputsystem_MacOS_6000.0_project 77.29% <10.74%> (-0.07%) ⬇️
inputsystem_MacOS_6000.3 5.31% <0.00%> (-0.02%) ⬇️
inputsystem_MacOS_6000.3_project 77.29% <10.74%> (-0.07%) ⬇️
inputsystem_MacOS_6000.4 5.31% <0.00%> (-0.02%) ⬇️
inputsystem_MacOS_6000.4_project 77.30% <10.74%> (-0.07%) ⬇️
inputsystem_MacOS_6000.5 5.31% <0.00%> (-0.02%) ⬇️
inputsystem_MacOS_6000.5_project 77.30% <10.74%> (-0.07%) ⬇️
inputsystem_Ubuntu_2022.3 5.53% <0.00%> (-0.02%) ⬇️
inputsystem_Ubuntu_2022.3_project 75.19% <3.30%> (-0.08%) ⬇️
inputsystem_Ubuntu_6000.0 5.31% <0.00%> (-0.02%) ⬇️
inputsystem_Ubuntu_6000.0_project 77.09% <10.74%> (-0.07%) ⬇️
inputsystem_Ubuntu_6000.3 5.31% <0.00%> (-0.02%) ⬇️
inputsystem_Ubuntu_6000.3_project 77.09% <10.74%> (-0.08%) ⬇️
inputsystem_Ubuntu_6000.4 5.32% <0.00%> (-0.02%) ⬇️
inputsystem_Ubuntu_6000.4_project 77.11% <10.74%> (-0.07%) ⬇️
inputsystem_Ubuntu_6000.5 5.32% <0.00%> (-0.02%) ⬇️
inputsystem_Ubuntu_6000.5_project 77.10% <10.74%> (-0.07%) ⬇️
inputsystem_Windows_2022.3 5.53% <0.00%> (-0.02%) ⬇️
inputsystem_Windows_2022.3_project 75.52% <3.30%> (-0.08%) ⬇️
inputsystem_Windows_6000.0 5.30% <0.00%> (-0.02%) ⬇️
inputsystem_Windows_6000.0_project 77.42% <10.74%> (-0.08%) ⬇️
inputsystem_Windows_6000.3 5.31% <0.00%> (-0.02%) ⬇️
inputsystem_Windows_6000.3_project 77.42% <10.74%> (-0.07%) ⬇️
inputsystem_Windows_6000.4 5.31% <0.00%> (-0.02%) ⬇️
inputsystem_Windows_6000.4_project 77.42% <10.74%> (-0.08%) ⬇️
inputsystem_Windows_6000.5 5.31% <0.00%> (-0.02%) ⬇️
inputsystem_Windows_6000.5_project 77.42% <10.74%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
Assets/Tests/InputSystem/CoreTests_Actions.cs 98.15% <ø> (+<0.01%) ⬆️
Assets/Tests/InputSystem/CoreTests_Analytics.cs 99.37% <100.00%> (+<0.01%) ⬆️
...InputSystem/Editor/Analytics/InputBuildAnalytic.cs 79.61% <100.00%> (+0.19%) ⬆️
...UITKAssetEditor/Views/NameAndParametersListView.cs 66.03% <100.00%> (+0.32%) ⬆️
...com.unity.inputsystem/InputSystem/InputSettings.cs 82.64% <100.00%> (+0.50%) ⬆️
...Editor/UITKAssetEditor/InputActionsEditorWindow.cs 54.65% <0.00%> (-0.26%) ⬇️
...nputSystem/Actions/Interactions/HoldInteraction.cs 59.61% <0.00%> (-4.97%) ⬇️
...tSystem/Actions/Interactions/SlowTapInteraction.cs 45.83% <0.00%> (-4.17%) ⬇️
...InputSystem/Actions/Interactions/TapInteraction.cs 63.23% <0.00%> (-3.96%) ⬇️
...ystem/Controls/Processors/AxisDeadzoneProcessor.cs 43.47% <0.00%> (-4.15%) ⬇️
... and 7 more

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@josepmariapujol-unity josepmariapujol-unity changed the title Revert: CHANGE: Deprecate useIMGUIEditorForAssets #2283 CHANGE: Revert: Deprecate useIMGUIEditorForAssets #2283 Feb 17, 2026
@jfreire-unity
Copy link
Collaborator

Do we have to revert this? Is there no way to fix it in the short term without reverting it? Maybe @K-Tone is already aware, but I just wanted to make sure.

@ritamerkl
Copy link
Collaborator

Do we have to revert this? Is there no way to fix it in the short term without reverting it? Maybe @K-Tone is already aware, but I just wanted to make sure.

This is being reverted for an regression it caused (see description). The IMGUI parts are still needed and reverting this partially is not easy since the scripts tie into each other. We will revisit this as soon as we have the capacity to untangle the dependencies to this code fully to be able to deprecate it safly.

@josepmariapujol-unity josepmariapujol-unity merged commit 00590b6 into develop Feb 18, 2026
107 checks passed
@josepmariapujol-unity josepmariapujol-unity deleted the input/uum-133864/serialize branch February 18, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants