diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index ee8d62752e..c66b94adf1 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -13,6 +13,7 @@ however, it has to be formatted properly to pass verification tests. ### Fixed - Fixed an issue where all action maps were enabled initially for project wide actions, which overrode the PlayerInput action map configuration. [ISXB-920](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-920) - Fixed an issue where ButtonStates are not fully updated when switching SingleUnifiedPointer. [ISXB-1356](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1356) +- Fixed errors when pasting composite parts into non-composites. [ISXB-757](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-757) ### Changed - Changed enum value `Key.IMESelected` to obsolete which was not a real key. Please use the ButtonControl `imeSelected`. diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionTreeView.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionTreeView.cs index 67df6c7c98..acaf8cfaa0 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionTreeView.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionTreeView.cs @@ -795,6 +795,10 @@ Type CopyTagToType(string tagName) var itemType = CopyTagToType(tag); if (location.item is ActionTreeItemBase dropTarget) { + // Specific case - Composite parts cannot be dropped into Bindings + if (tag == k_PartOfCompositeBindingTag && location.item is not(CompositeBindingTreeItem or PartOfCompositeBindingTreeItem)) + return; + if (!dropTarget.GetDropLocation(itemType, location.childIndex, ref array, ref arrayIndex)) return; } diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputBindingPropertiesView.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputBindingPropertiesView.cs index 6e196023a4..d134bfdd87 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputBindingPropertiesView.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputBindingPropertiesView.cs @@ -94,12 +94,16 @@ protected override void DrawGeneralProperties() if (m_CompositeParts == null) InitializeCompositePartProperties(); - var selectedPart = EditorGUILayout.Popup(s_CompositePartAssignmentLabel, m_SelectedCompositePart, - m_CompositePartOptions); - if (selectedPart != m_SelectedCompositePart) + // If m_CompositeParts still null after InitializeCompositePartProperties something went wrong and we can't select + if (m_CompositeParts != null) { - m_SelectedCompositePart = selectedPart; - OnCompositePartAssignmentChanged(); + var selectedPart = EditorGUILayout.Popup(s_CompositePartAssignmentLabel, m_SelectedCompositePart, + m_CompositePartOptions); + if (selectedPart != m_SelectedCompositePart) + { + m_SelectedCompositePart = selectedPart; + OnCompositePartAssignmentChanged(); + } } } diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Commands/Commands.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Commands/Commands.cs index 999f14353b..66b1787af5 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Commands/Commands.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Commands/Commands.cs @@ -266,7 +266,8 @@ public static Command PasteActionsOrBindings(List pasteListeners else lastPastedElement = CopyPasteHelper.PasteActionsOrBindingsFromClipboard(state.With(selectedBindingIndex: newIndex >= 0 ? newIndex : state.selectedBindingIndex)); - lastPastedElement.FindPropertyRelative("m_Action").stringValue = relatedAction.Value.name; + if (lastPastedElement != null) + lastPastedElement.FindPropertyRelative("m_Action").stringValue = relatedAction.Value.name; } }