From 673c15d22c8aca288171650a7d64dc0548540d99 Mon Sep 17 00:00:00 2001 From: Trudy Spiller Date: Wed, 13 Nov 2024 10:21:18 +0000 Subject: [PATCH 1/2] Check deviceIndex is valid in currentControlScheme --- .../InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs index 5449932711..a0b6029a9b 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs @@ -691,7 +691,7 @@ private static bool ShouldBindingBeVisible(SerializedInputBinding serializedInpu if (currentControlScheme.HasValue && !string.IsNullOrEmpty(currentControlScheme.Value.name)) { var isMatchingDevice = true; - if (deviceIndex >= 0) + if (deviceIndex >= 0 && deviceIndex < currentControlScheme.Value.deviceRequirements.Count) { var devicePathToMatch = InputControlPath.TryGetDeviceLayout(currentControlScheme.Value.deviceRequirements.ElementAt(deviceIndex).controlPath); var devicePath = InputControlPath.TryGetDeviceLayout(serializedInputBinding.path); From b79406efae7f2658f5481d9b833efa2c840ae71c Mon Sep 17 00:00:00 2001 From: Trudy Spiller Date: Wed, 13 Nov 2024 10:48:46 +0000 Subject: [PATCH 2/2] Update CHANGELOG.md --- Packages/com.unity.inputsystem/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index a1969a7bd0..caa9453f8d 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -22,6 +22,7 @@ however, it has to be formatted properly to pass verification tests. - 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) +- Fixed `ArgumentOutOfRangeException` when adding a new Control Scheme with any Device selected. [ISXB-1129](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1129) ### Changed - Added back the InputManager to InputSystem project-wide asset migration code with performance improvement (ISX-2086).