Skip to content

Commit 6094fc4

Browse files
authored
Merge branch 'develop' into isxb-1024-action-navigation-after-rename
2 parents aeedaec + 9ab25ab commit 6094fc4

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ however, it has to be formatted properly to pass verification tests.
2020
- Fixed unexpected control scheme switch when using `OnScreenControl` and pointer based schemes which registed "Cancel" event on every frame.[ISXB-656](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-656).
2121
- 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).
2222
- 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.
23+
- Fixed pasting into an empty map list raising an exception. [ISXB-1150](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1150)
2324
- Fixed arrow key navigation of Input Actions after Action rename. [ISXB-1024](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1024)
2425

2526
### Changed

Packages/com.unity.inputsystem/InputSystem/Devices/Mouse.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ public struct MouseState : IInputStateTypeInfo
2626
/// Screen-space position of the mouse in pixels.
2727
/// </summary>
2828
/// <value>Position of mouse on screen.</value>
29+
/// <remarks>
30+
/// On Windows, delta originates from RAWINPUT API.
31+
/// Note: This value might not update every frame, particularly if your project is running at a high frame rates. This value might also update at a different time than the <see cref="Pointer.delta"/>. If you need a delta value that correlates with position, you should compute it based on the previous position value.
32+
/// </remarks>
2933
/// <seealso cref="Pointer.position"/>
3034
[InputControl(usage = "Point", dontReset = true)] // Mouse should stay put when we reset devices.
3135
[FieldOffset(0)]
@@ -35,6 +39,10 @@ public struct MouseState : IInputStateTypeInfo
3539
/// Screen-space motion delta of the mouse in pixels.
3640
/// </summary>
3741
/// <value>Mouse movement.</value>
42+
/// <remarks>
43+
/// On Windows, delta originates from RAWINPUT API.
44+
/// Note: This value might not update every frame, particularly if your project is running at a high frame rates. This value might also update at a different time than the <see cref="Pointer.position"/>. If you need a delta value that correlates with position, you should compute it based on the previous position value.
45+
/// </remarks>
3846
/// <seealso cref="Pointer.delta"/>
3947
[InputControl(usage = "Secondary2DMotion", layout = "Delta")]
4048
[FieldOffset(8)]

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/CopyPasteHelper.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ internal static void PasteItems(string copyBufferString, int[] indicesToInsert,
243243
// Split buffer into transmissions and then into transmission blocks
244244
var copiedType = GetCopiedType(copyBufferString);
245245
int indexOffset = 0;
246+
// If the array is empty, make sure we insert at index 0
247+
if (arrayToInsertInto.arraySize == 0)
248+
indexOffset = -1;
246249
foreach (var transmission in copyBufferString.Substring(k_CopyPasteMarker.Length + k_TypeMarker[copiedType].Length)
247250
.Split(new[] {k_EndOfTransmission}, StringSplitOptions.RemoveEmptyEntries))
248251
{

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/Selectors.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,12 @@ public static int GetSelectedBindingIndexAfterCompositeBindings(InputActionsEdit
114114

115115
public static int GetBindingIndexBeforeAction(SerializedProperty arrayProperty, int indexToInsert, SerializedProperty bindingArrayToInsertTo)
116116
{
117-
Debug.Assert(indexToInsert >= 0 && indexToInsert <= arrayProperty.arraySize, "Invalid action index to insert bindings before.");
117+
// Need to guard against this case, as there is different behaviour when pasting actions vs actionmaps
118+
if (indexToInsert < 0)
119+
{
120+
return -1;
121+
}
122+
Debug.Assert(indexToInsert <= arrayProperty.arraySize, "Invalid action index to insert bindings before.");
118123
var offset = 1; //previous action offset
119124
while (indexToInsert - offset >= 0)
120125
{

0 commit comments

Comments
 (0)