From b0478f0cb4a139f5af3d43e5705765df1357af60 Mon Sep 17 00:00:00 2001 From: Alex Tyrer Date: Wed, 13 Nov 2024 09:29:41 +0000 Subject: [PATCH] [Input System] Fixed pasting bindings into empty Input Action asset (case ISXB-1180) (#2046) FIX: Fixed pasting bindings into empty Input Action asset (case ISXB-1180) --- Packages/com.unity.inputsystem/CHANGELOG.md | 1 + .../InputSystem/Editor/UITKAssetEditor/Views/CopyPasteHelper.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 4220897bf..a1969a7bd 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -21,6 +21,7 @@ however, it has to be formatted properly to pass verification tests. - Fixed an issue with The "Add Control Scheme..." popup window so that it now persists until any changes are explicitly Saved or Cancelled [case ISXB-1131](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1131). - Fixed missing documentation for source generated Input Action Assets. This is now generated as part of the source code generation step when "Generate C# Class" is checked in the importer inspector settings. - Fixed pasting into an empty map list raising an exception. [ISXB-1150](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1150) +- Fixed pasting bindings into empty Input Action asset. [ISXB-1180](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1180) ### Changed - Added back the InputManager to InputSystem project-wide asset migration code with performance improvement (ISX-2086). diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/CopyPasteHelper.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/CopyPasteHelper.cs index 35cb752a8..3d2fad810 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/CopyPasteHelper.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/CopyPasteHelper.cs @@ -221,7 +221,7 @@ namespace UnityEngine.InputSystem.Editor { var actionMap = Selectors.GetSelectedActionMap(state)?.wrappedProperty; var bindingsArray = actionMap?.FindPropertyRelative(nameof(InputActionMap.m_Bindings)); - + if (bindingsArray == null) return; int newBindingIndex; if (state.selectionType == SelectionType.Action) newBindingIndex = Selectors.GetLastBindingIndexForSelectedAction(state);