Skip to content

Commit 1a22faf

Browse files
author
Rene Damm
committed
MERGE: develop => stable.
2 parents aacd1d9 + 2371d05 commit 1a22faf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+600
-429
lines changed

.yamato/upm-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ platforms:
4949
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
5050
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u {{ editor.version }}
5151
- {% if platform.installscript %} {{ platform.installscript }} {{ editor.version }} {% endif %}
52-
- upm-ci~/tools/utr/utr --testproject=. --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode --api-profile=NET_4_6 --stdout-filter=minimal {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %}
52+
- upm-ci~/tools/utr/utr --testproject $PWD --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode --api-profile=NET_4_6 --stdout-filter=minimal {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %}
5353
triggers:
5454
branches:
5555
only:
@@ -81,4 +81,4 @@ publish:
8181
artifacts:
8282
artifacts:
8383
paths:
84-
- "upm-ci~/packages/*.tgz"
84+
- "upm-ci~/packages/*.tgz"

Assets/Tests/InputSystem/CoreTests_Controls.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using UnityEngine.InputSystem.LowLevel;
1010
using UnityEngine.InputSystem.Processors;
1111
using UnityEngine.InputSystem.Utilities;
12+
using UnityEngine.Scripting;
1213
using UnityEngine.TestTools.Constraints;
1314
using Is = UnityEngine.TestTools.Constraints.Is;
1415

@@ -1021,6 +1022,22 @@ public void Controls_CanTurnControlPathIntoHumanReadableText()
10211022
InputControlPath.HumanReadableStringOptions.OmitDevice), Is.EqualTo("PrimaryAction"));
10221023
}
10231024

1025+
[Preserve]
1026+
private class DeviceWithoutAnyControls : InputDevice
1027+
{
1028+
}
1029+
1030+
[Test]
1031+
[Category("Controls")]
1032+
public void Controls_CanTurnControlPathIntoHumanReadableText_EvenIfLayoutCannotBeFoundOrHasErrors()
1033+
{
1034+
// This one will throw as the layout will result in a zero-size memory block.
1035+
InputSystem.RegisterLayout<DeviceWithoutAnyControls>();
1036+
1037+
Assert.That(InputControlPath.ToHumanReadableString("<UnknownGamepad>/leftStick"), Is.EqualTo("leftStick [UnknownGamepad]"));
1038+
Assert.That(InputControlPath.ToHumanReadableString("<DeviceWithoutAnyControls>/control"), Is.EqualTo("control [DeviceWithoutAnyControls]"));
1039+
}
1040+
10241041
[Test]
10251042
[Category("Controls")]
10261043
public void Controls_CanCheckIfControlMatchesGivenPath()
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System.Collections.Generic;
2+
using System.Linq;
3+
using NUnit.Framework;
4+
using UnityEngine.InputSystem.Utilities;
5+
6+
public class InlinedArrayTests
7+
{
8+
[Test]
9+
[Category("Utilities")]
10+
[TestCase(1, 0)]
11+
[TestCase(2, 0)]
12+
[TestCase(3, 0)]
13+
[TestCase(2, 1)]
14+
[TestCase(3, 1)]
15+
[TestCase(3, 2)]
16+
[TestCase(10, 0)]
17+
[TestCase(10, 5)]
18+
[TestCase(10, 9)]
19+
public void Utilities_InlinedArray_CanRemoveElementAtIndex(int count, int removeAt)
20+
{
21+
var comparisonList = new List<string>();
22+
var array = new InlinedArray<string>();
23+
24+
for (var i = 0; i < count; ++i)
25+
{
26+
comparisonList.Add(i.ToString());
27+
array.Append(i.ToString());
28+
}
29+
30+
Assert.That(array.length, Is.EqualTo(comparisonList.Count));
31+
32+
array.RemoveAt(removeAt);
33+
comparisonList.RemoveAt(removeAt);
34+
35+
Assert.That(array, Is.EquivalentTo(comparisonList));
36+
}
37+
}

Assets/Tests/InputSystem/Utilities/InlinedArrayTests.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
Due to package verification, the latest version below is the unpublished version and the date is meaningless.
88
however, it has to be formatted properly to pass verification tests.
99

10+
## [1.0.0-preview.3] - 2019-11-14
11+
12+
### Fixed
13+
14+
- Fixed wrong event handlers getting removed when having three or more handlers on an event (case 1196143).
15+
* This was an bug in an internal data structure that impacted a number of code paths that were using the data structure.
16+
- Fixed `LayoutNotFoundException` being thrown when `InputControlPath.ToHumanReadableString` referenced a layout that could not be found.
17+
1018
## [1.0.0-preview.2] - 2019-11-4
1119

1220
### Changed

Packages/com.unity.inputsystem/Documentation~/ActionAssets.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ An Input Action Asset is an Asset containing [Input Actions](Actions.md) as well
88

99
## Creating Input Action Assets
1010

11-
To create an Asset containing [Input Acions](Actions.md) in Unity, right-click in the __Project__ window or go to __Assets > Create > Input Actions__ in Unity's main menu.
11+
To create an Asset containing [Input Actions](Actions.md) in Unity, right-click in the __Project__ window or go to __Assets > Create > Input Actions__ from Unity's main menu.
1212

1313
## Editing Input Action Assets
1414

15-
To bring up the Action editor, double-click an `.inputactions` asset in the Project Browser or click the __Edit Asset__ button in the inspector for that Asset. You can have more than one editor window open at the same time, but not for the same Asset.
15+
To bring up the Action editor, double-click an `.inputactions` Asset in the Project Browser, or click the __Edit Asset__ button in the inspector for that Asset. You can have more than one editor window open at the same time, but not for the same Asset.
1616

1717
![Action Editor Window](Images/MyGameActions.png)
1818

@@ -24,7 +24,7 @@ By default, Unity doesn't save edits you make in the Action Asset window when yo
2424

2525
>__Note__: This setting affects all `.inputactions` Assets, and persists across Unity Editor sessions.
2626
27-
The editor window is divided into three panes.
27+
The editor window is divided into three panes:
2828

2929
1. The left pane lists the Action Maps in the Asset. Each Map is a collection of Actions that you can enable or disable in bulk.
3030
2. The middle pane contains the Actions in the currently selected Action Map, and the bindings associated with each Action.
@@ -34,16 +34,16 @@ Use the following keyboard shortcuts to quickly trigger common operations:
3434

3535
|Shortcut (Mac)|Shortcut (Windows)|Description|
3636
|--------------|------------------|-----------|
37-
|⌘X, ⌘C, ⌘V|Ctrl-X, Ctrl-C, Ctrl-V|Cut, Copy and Paste. Can be used on Actions, Action Maps and Bindings.|
38-
|⌘D|Ctrl-D|Duplicate. Can be used on Actions, Action Maps and Bindings.|
39-
|⌘⌫|Del|Delete. Can be used on Actions, Action Maps and Bindings.|
37+
|⌘X, ⌘C, ⌘V|Ctrl-X, Ctrl-C, Ctrl-V|Cut, Copy, and Paste. Can be used on Actions, Action Maps, and Bindings.|
38+
|⌘D|Ctrl-D|Duplicate. Can be used on Actions, Action Maps, and Bindings.|
39+
|⌘⌫|Del|Delete. Can be used on Actions, Action Maps, and Bindings.|
4040
|⌥S|Alt-S|Save.|
4141
|⌥M|Alt-M|Add Action Map.|
4242
|⌥A|Alt-A|Add Action.|
4343
|⌥B|Alt-B|Add Binding.|
4444

4545

46-
>__Tip__: You can search for Devices and/or Control Schemes directly from the search box. For example, "d:gamepad" filters for bindings to gamepad Devices, whereas "g:gamepad" filters for bindings in the "gamepad" Control Scheme. Matching is case-insensitive and will match any partial name.
46+
>__Tip__: You can search for Devices and/or Control Schemes directly from the search box. For example, "d:gamepad" filters for bindings to gamepad Devices, whereas "g:gamepad" filters for bindings in the "gamepad" Control Scheme. Matching is case-insensitive and matches any partial name.
4747
4848
### Editing Action Maps
4949

@@ -52,7 +52,7 @@ Use the following keyboard shortcuts to quickly trigger common operations:
5252
>__Note__: Action Map names can't contain slashes (`/`).
5353
5454
* To add a new Action Map, click the plus icon in the header of the Action Map column.
55-
* To rename an existing Action Map, either long-click the name, or right-click the action map and select __Rename__ from the context menu.
55+
* To rename an existing Action Map, either long-click the name, or right-click the Action Map and select __Rename__ from the context menu.
5656
* To delete an existing Action Map, either right-click it and select __Delete__ from the context menu, or use the Delete key (Windows) / ⌘⌫ (Mac).
5757
* To duplicate an existing Action Map, either right-click it and select __Duplicate__ from the context menu, or use Ctrl-D (Windows) / ⌘D (Mac).
5858

@@ -81,7 +81,7 @@ If you select a Binding, you can edit its properties in the right-hand pane of t
8181

8282
#### Picking Controls
8383

84-
The most important property of any Binding is the [control path](Controls.md#control-paths) it's bound to. To edit it, open the __Path__ drop-down list. This will pop up a Control picker window.
84+
The most important property of any Binding is the [control path](Controls.md#control-paths) it's bound to. To edit it, open the __Path__ drop-down list. This pops up a Control picker window.
8585

8686
![Control Picker](Images/InputControlPicker.png)
8787

@@ -131,8 +131,8 @@ using UnityEngine.InputSystem;
131131
// checkbox.
132132
public class MyPlayerScript : MonoBehaviour, IGameplayActions
133133
{
134-
// MyPlayerControls is the C# class that has been generated for us.
135-
// It encapsulates the data from the .inputactions asset we created
134+
// MyPlayerControls is the C# class that Unity generated.
135+
// It encapsulates the data from the .inputactions asset we created
136136
// and automatically looks up all the maps and actions for us.
137137
MyPlayerControls controls;
138138

@@ -168,6 +168,6 @@ public class MyPlayerScript : MonoBehaviour, IGameplayActions
168168

169169
### Using Action Assets with `PlayerInput`
170170

171-
The [`PlayerInput`](Components.md#playerinput-component) component provides a convenient way to handle input for one or multiple players. It requires you to set up all your Actions in an Input Action Asset, which you can then assign to the [`PlayerInput`](Components.md#playerinput-component) component. [`PlayerInput`](Components.md#playerinput-component) can then automatically handle activating Action Maps and selecting Control Schemes for you. Check the documentation on [GameObject Components for Input](Components.md) to learn more.
171+
The [`PlayerInput`](Components.md#playerinput-component) component provides a convenient way to handle input for one or multiple players. It requires you to set up all your Actions in an Input Action Asset, which you can then assign to the [`PlayerInput`](Components.md#playerinput-component) component. [`PlayerInput`](Components.md#playerinput-component) can then automatically handle activating Action Maps and selecting Control Schemes for you. To learn more, see the documentation on [GameObject Components for Input](Components.md).
172172

173173
![PlayerInput](Images/PlayerInput.png)

0 commit comments

Comments
 (0)