From 4248638040aa3d9a97ce0d5464f76905fe0453fd Mon Sep 17 00:00:00 2001 From: Anthony Yakovlev Date: Wed, 11 Mar 2026 21:05:18 +0300 Subject: [PATCH] Fix ISXB-1794: Processor (and interaction) list use composite part value type, not composite - When selection is a composite part binding, resolve expected value type from the part's expected control layout (e.g. float for Axis) instead of the action/composite type (e.g. Vector2). - Add GetExpectedValueTypeForProcessorsOrInteractions and use it for both processors and interactions. Made-with: Cursor --- .../Editor/UITKAssetEditor/Views/Selectors.cs | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/Selectors.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/Selectors.cs index 9c639541ac..bba212835e 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/Selectors.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/Selectors.cs @@ -311,9 +311,7 @@ public static IEnumerable BuildControlTypeList(InputActionType selectedA public static IEnumerable GetInteractionsAsParameterListViews(InputActionsEditorState state, SerializedInputAction? inputAction) { - Type expectedValueType = null; - if (inputAction.HasValue && !string.IsNullOrEmpty(inputAction.Value.expectedControlType)) - expectedValueType = EditorInputControlLayoutCache.GetValueType(inputAction.Value.expectedControlType); + var expectedValueType = GetExpectedValueTypeForProcessorsOrInteractions(state, inputAction); var interactions = string.Empty; if (inputAction.HasValue && state.selectionType == SelectionType.Action) @@ -328,13 +326,35 @@ public static IEnumerable GetInteractionsAsParameterListViews InputInteraction.GetValueType); } - public static IEnumerable GetProcessorsAsParameterListViews(InputActionsEditorState state, SerializedInputAction? inputAction) + /// + /// Expected value type for the current selection. When the selection is a composite part binding, + /// returns the part's value type (e.g. float) instead of the composite's (e.g. Vector2). ISXB-1794. + /// + private static Type GetExpectedValueTypeForProcessorsOrInteractions(InputActionsEditorState state, SerializedInputAction? inputAction) { - var processors = string.Empty; - Type expectedValueType = null; + if (state.selectionType == SelectionType.Binding) + { + var binding = GetSelectedBinding(state); + if (binding.HasValue && binding.Value.isPartOfComposite) + { + var compositeName = NameAndParameters.Parse(binding.Value.compositePath).name; + var partName = binding.Value.name; + var expectedLayout = InputBindingComposite.GetExpectedControlLayoutName(compositeName, partName); + if (!string.IsNullOrEmpty(expectedLayout)) + return EditorInputControlLayoutCache.GetValueType(expectedLayout); + } + } if (inputAction.HasValue && !string.IsNullOrEmpty(inputAction.Value.expectedControlType)) - expectedValueType = EditorInputControlLayoutCache.GetValueType(inputAction.Value.expectedControlType); + return EditorInputControlLayoutCache.GetValueType(inputAction.Value.expectedControlType); + + return null; + } + + public static IEnumerable GetProcessorsAsParameterListViews(InputActionsEditorState state, SerializedInputAction? inputAction) + { + var processors = string.Empty; + var expectedValueType = GetExpectedValueTypeForProcessorsOrInteractions(state, inputAction); if (inputAction.HasValue && state.selectionType == SelectionType.Action) processors = inputAction.Value.processors;