Skip to content

Commit 9393fbc

Browse files
authored
Merge branch 'develop' into docs-processors
2 parents 8988c27 + f42eb5e commit 9393fbc

File tree

13 files changed

+182
-48
lines changed

13 files changed

+182
-48
lines changed

.github/codecov.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
codecov:
2+
max_report_age: false
3+
require_ci_to_pass: false
4+
notify:
5+
wait_for_ci: true
6+
7+
coverage:
8+
precision: 2
9+
round: down
10+
range: "50...70"
11+
status:
12+
patch: true
13+
default_rules:
14+
flag_coverage_not_uploaded_behavior: exclude
15+
project:
16+
default:
17+
target: auto
18+
threshold: 1%
19+
base: auto
20+
if_ci_failed: success
21+
informational: true
22+
only_pulls: true
23+
24+
comment:
25+
layout: "diff,flags,files"
26+
behavior: default
27+
require_changes: false
28+
require_base: true
29+
require_head: true
30+
after_n_builds: 1
31+
32+
flag_management:
33+
default_rules:
34+
carryforward: true

.yamato/upm-ci.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
2727
# Run upm-ci verification tests as well as tests contained in the package.
2828
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u %EDITOR_VERSION%
29-
{% if platform.name == "win" and category.name == "functional" %} --enable-code-coverage --code-coverage-options "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;pathReplacePatterns:@*,,Library/PackageCache,Packages"
30-
--extra-utr-arg="--coverage-results-path={{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Package" {% endif %}
29+
{% if platform.name == "win" and category.name == "functional" %} --enable-code-coverage --code-coverage-options "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;pathReplacePatterns:@*,,Library/PackageCache,Packages" --extra-utr-arg="--coverage-results-path={{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Package --coverage-upload-options=\"reportsDir:upm-ci~/test-results/CodeCoverage/Package;name:{{platform.name}}_{{editor.version}}_pkg;flags:{{platform.name}}_{{editor.version}}_pkg\"" {% endif %}
3130
{% if platform.installscript %}
3231
- {{ unity_downloader_install }}
3332
- {{ platform.installscript }} %EDITOR_VERSION%
@@ -37,11 +36,9 @@
3736
- move /Y .\Packages\com.unity.inputsystem\Samples .\Assets
3837
- move /Y .\Packages\com.unity.inputsystem\Samples.meta .\Assets
3938
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
40-
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "win" %} --suite=editor {% endif %} {% if category.name == "performance" %} --category=Performance {% else %} --category=!Performance {% endif %} --api-profile=NET_4_6 {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} {% if category.name == "performance" %} --report-performance-data --performance-project-id=InputSystem {% endif %} {% if platform.name == "win" and category.name == "functional" %}--enable-code-coverage --coverage-options="generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem" --coverage-results-path={{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Project {% endif %}
41-
# Merge all the code coverage results into one report.
39+
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "win" %} --suite=editor {% endif %} {% if category.name == "performance" %} --category=Performance {% else %} --category=!Performance {% endif %} --api-profile=NET_4_6 {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} {% if category.name == "performance" %} --report-performance-data --performance-project-id=InputSystem {% endif %} {% if platform.name == "win" and category.name == "functional" %}--enable-code-coverage --coverage-options="generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem" --coverage-results-path={{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Project --coverage-upload-options="reportsDir:upm-ci~/test-results/CodeCoverage/Project;name:{{platform.name}}_{{editor.version}}_project;flags:{{platform.name}}_{{editor.version}}_project" {% endif %}
4240
{% if platform.name == "win" and category.name == "functional" %}
43-
- '{{ yamato_source_dir_win }}/.Editor/Unity.exe -projectPath {{ yamato_source_dir_win }} -batchmode -debugCodeOptimization -enableCodeCoverage -coverageResultsPath {{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/ -coverageOptions "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;sourcePaths:{{ yamato_source_dir_win }}/Packages/com.unity.inputsystem/" -quit'
44-
# Delete the Package and Project reports, only keep the final merged one to keep Aritfacts.zip smaller
41+
# Delete the Package and Project reports & raw coverage data, to keep Artifacts.zip smaller
4542
- rmdir /s/q "{{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Package"
4643
- rmdir /s/q "{{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Project"
4744
{% endif %}
@@ -52,6 +49,11 @@
5249
UTR_Output.zip:
5350
paths:
5451
- "upm-ci~/test-results/**/*"
52+
{% if platform.name == "win" and category.name == "functional" %}
53+
triggers:
54+
expression: push.branch eq "develop"
55+
cancel_old_ci: true
56+
{% endif %}
5557
{% endfor %} # test_category
5658
{% endfor %} # platforms_win
5759

@@ -77,7 +79,7 @@
7779
- mv ./Assets/Samples.meta ./Packages/com.unity.inputsystem
7880
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
7981
# Run upm-ci verification tests as well as tests contained in the package.
80-
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u $EDITOR_VERSION {% if category.name == "functional" and platform.name == "mac" or platform.name == "linux" %} --enable-code-coverage --code-coverage-options "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;pathReplacePatterns:@*,,Library/PackageCache,Packages" --extra-utr-arg="--coverage-results-path={{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Package" {% endif %}
82+
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u $EDITOR_VERSION {% if category.name == "functional" and platform.name == "mac" or platform.name == "linux" %} --enable-code-coverage --code-coverage-options "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;pathReplacePatterns:@*,,Library/PackageCache,Packages" --extra-utr-arg="--coverage-results-path={{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Package --coverage-upload-options=\"reportsDir:upm-ci~/test-results/CodeCoverage/Package;name:{{platform.name}}_{{editor.version}}_pkg;flags:{{platform.name}}_{{editor.version}}_pkg\"" {% endif %}
8183
{% if platform.installscript %}
8284
- {{ unity_downloader_install }}
8385
- {{ platform.installscript }} $EDITOR_VERSION
@@ -87,24 +89,24 @@
8789
- mv ./Packages/com.unity.inputsystem/Samples ./Assets
8890
- mv ./Packages/com.unity.inputsystem/Samples.meta ./Assets
8991
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
90-
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "mac" or platform.name == "linux"%} --suite=editor {% endif %} {% if category.name == "performance" %} --category=Performance {% else %} --category=!Performance {% endif %} --api-profile=NET_4_6 {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} {% if category.name == "performance" %} --report-performance-data --performance-project-id=InputSystem {% endif %} {% if category.name == "functional" and platform.name == "mac" or platform.name == "linux" %} --enable-code-coverage --coverage-options="generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem" --coverage-results-path={{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Project {% endif %}
91-
# Merge all the code coverage results into one report.
92-
{% if platform.name == "mac" and category.name == "functional" %}
93-
- '{{ yamato_source_dir_nix }}/.Editor/Unity.app/Contents/MacOS/Unity -projectPath {{ yamato_source_dir_nix }} -batchmode -debugCodeOptimization -enableCodeCoverage -coverageResultsPath {{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/ -coverageOptions "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;sourcePaths:{{ yamato_source_dir_nix }}/Packages/com.unity.inputsystem/" -quit'
94-
{% endif %}
95-
{% if platform.name == "linux" and category.name == "functional" %}
96-
- '{{ yamato_source_dir_nix }}/.Editor/Unity -projectPath {{ yamato_source_dir_nix }} -batchmode -debugCodeOptimization -enableCodeCoverage -coverageResultsPath {{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/ -coverageOptions "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;sourcePaths:{{ yamato_source_dir_nix }}/Packages/com.unity.inputsystem/" -quit'
97-
{% endif %}
98-
# Delete the Package and Project reports, only keep the final merged one to keep Aritfacts.zip smaller
92+
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "mac" or platform.name == "linux"%} --suite=editor {% endif %} {% if category.name == "performance" %} --category=Performance {% else %} --category=!Performance {% endif %} --api-profile=NET_4_6 {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} {% if category.name == "performance" %} --report-performance-data --performance-project-id=InputSystem {% endif %} {% if category.name == "functional" and platform.name == "mac" or platform.name == "linux" %} --enable-code-coverage --coverage-options="generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem" --coverage-results-path={{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Project --coverage-upload-options="reportsDir:upm-ci~/test-results/CodeCoverage/Project;name:{{platform.name}}_{{editor.version}}_project;flags:{{platform.name}}_{{editor.version}}_project" {% endif %}
93+
{% if category.name == "functional" and platform.name == "mac" or platform.name == "linux"%}
94+
# Delete the Package and Project reports & raw coverage data, to keep Artifacts.zip smaller
9995
- rm -rf {{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Package
100-
- rm -rf {{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Project
96+
- rm -rf {{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Project
97+
{% endif %}
10198
after:
10299
- {{ instabilities_install_nix }}
103100
- {{ platform.instabilities_run }}
104101
artifacts:
105102
UTR_Output.zip:
106103
paths:
107104
- "upm-ci~/test-results/**/*"
105+
{% if category.name == "functional" and platform.name == "mac" or platform.name == "linux"%}
106+
triggers:
107+
expression: push.branch eq "develop"
108+
cancel_old_ci: true
109+
{% endif %}
108110
{% endfor %} # test_category
109111
{% endfor %} # platforms_nix
110112
{% endfor %} # editors

Assets/Tests/InputSystem/CoreTests_Actions_Interactions.cs

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,78 @@ public void Actions_CanPerformTapInteraction()
669669
Assert.That(action.phase, Is.EqualTo(InputActionPhase.Waiting));
670670
}
671671

672+
[Test]
673+
[Category("Actions")]
674+
public void Actions_CanPerformTapInteractionWithAnalogControls()
675+
{
676+
ResetTime();
677+
678+
var gamepad = InputSystem.AddDevice<Gamepad>();
679+
680+
var action = new InputAction(binding: "<Gamepad>/leftTrigger", type: InputActionType.Button,
681+
interactions: "tap(duration=0.2)");
682+
683+
// This is the default value, which makes the release point to be 0.75 * 0.5 = 0.375.
684+
InputSystem.settings.defaultButtonPressPoint = 0.5f;
685+
686+
action.Enable();
687+
688+
currentTime = 0f;
689+
690+
using (var trace = new InputActionTrace())
691+
{
692+
trace.SubscribeTo(action);
693+
694+
currentTime = 0.1f;
695+
Set(gamepad.leftTrigger, 0.3f);
696+
currentTime = 0.2f;
697+
Set(gamepad.leftTrigger, 0.54f);
698+
699+
Assert.That(trace,
700+
Started<TapInteraction>(action, value: 0.54f, time: 0.2f));
701+
trace.Clear();
702+
703+
// Assert that a timeout will ocurr and a canceled event will be triggered.
704+
currentTime = 0.5f;
705+
Set(gamepad.leftTrigger, 0.9f);
706+
Assert.That(trace,
707+
Canceled<TapInteraction>(action));
708+
trace.Clear();
709+
710+
// Maintain a value above the press point for a while to assess that a start event is not triggered.
711+
// This was the case where the tap interaction was previously re-starting.
712+
currentTime = 1.2f;
713+
Set(gamepad.leftTrigger, 0.52f);
714+
715+
Assert.That(trace, Is.Empty);
716+
717+
// Go below the release point so check that no cancel event is triggered, since it didn't start.
718+
// This was the case where the tap interaction was previously re-starting and then would cancel after
719+
// timeout.
720+
currentTime = 1.5f;
721+
Set(gamepad.leftTrigger, 0.2f);
722+
723+
Assert.That(trace, Is.Empty);
724+
725+
// Go above the press point again and check that a start event is triggered.
726+
currentTime = 2.0f;
727+
Set(gamepad.leftTrigger, 0.6f);
728+
729+
Assert.That(trace,
730+
Started<TapInteraction>(action));
731+
trace.Clear();
732+
733+
currentTime = 2.10f;
734+
Set(gamepad.leftTrigger, 0.4f);
735+
736+
// Check that the tap is performed.
737+
currentTime = 2.15f;
738+
Set(gamepad.leftTrigger, 0.2f);
739+
Assert.That(trace,
740+
Performed<TapInteraction>(action));
741+
}
742+
}
743+
672744
[Test]
673745
[Category("Actions")]
674746
public void Actions_CanPerformDoubleTapInteraction()

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ however, it has to be formatted properly to pass verification tests.
2222
- Fixed Inspector Window being refreshed all the time when a PlayerInput component is present with Invoke Unity Events nofication mode chosen [ISXB-1448](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1448)
2323
- Fixed an issue where an action with a name containing a slash "/" could not be found via `InputActionAsset.FindAction(string,bool)`. [ISXB-1306](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1306).
2424
- Fixed Gamepad stick up/down inputs that were not recognized in WebGL. [ISXB-1090](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1090)
25+
- Fixed reenabling the VirtualMouseInput component may sometimes lead to NullReferenceException. [ISXB-1096](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1096)
2526
- Fixed PlayerInput component automatically switching away from the default ActionMap set to 'None'.
2627
- Fixed a console error being shown when targeting visionOS builds in 2022.3.
28+
- Fixed a Tap Interaction issue with analog controls. The Tap interaction would keep re-starting after timeout. [ISXB-627](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-627)
2729

2830
## [1.14.0] - 2025-03-20
2931

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ uid: basic-concepts
55

66
This page introduces the basic concepts that relate to working with the Input System. They relate to the steps in the sequence of events that occur when a user sends input to your game or app. The Input System provides features which implement these steps, or you can choose to implement some of them yourself.
77

8-
![](Images/ConceptsOverview.png)
8+
![A flowchart showing the general workflow of the Input System, with icons representing the different concepts. It starts with the User icon, which then leads into the Input Device and its Controls icon. This then leads into the Action Map and Actions concept. The Input Device and Action Map and Actions icons are collectively grouped under the Binding header. This leads into the final icon representing your action code.](Images/ConceptsOverview.png)
99

1010
|Concept|Description|
1111
|-------|-----------|
Binary file not shown.
Binary file not shown.
Binary file not shown.

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,22 @@ Unless you have specific project requirements that require more than one Action
1818
To create and assign the current project-wide actions, go to **Edit** > **Project Settings** > **Input System Package**.
1919

2020
If you don't yet have an Action Asset assigned as project-wide in your project, the Input System Package settings window displays an empty field for you to assign your action asset, and a button allowing you to create and assign one.
21-
![image alt text](./Images/InputSettingsNoProjectWideAsset.png)</br>
22-
*The Input System Package Project Settings with no project-wide actions assigned*
21+
22+
![Screenshot of the Project Settings window, with Input System Package selected. Its settings are displayed on the right of the window. The Project-wide Actions field is empty, and an information box explaining you can assign an Action Asset as project-wide by selecting it in this field or creating it in this window is shown. A button to automatically create and assign the default project-wide Action Asset is displayed under the information box.](./Images/InputSettingsNoProjectWideAsset.png)</br>
23+
*The Input System Package Project Settings with no project-wide actions assigned displays a button to create and assign a default project-wide Action Asset.*
2324

2425
> **Note:** If you already have an Action Asset assigned, this button is not displayed, and instead the Actions Editor is displayed, allowing you to edit the project-wide actions.
2526
2627
To create an Action Asset with default actions pre-configured, click **"Create a new project-wide Action Asset"**. The asset is created in your project, and automatically assigned as the **project-wide actions**.
2728

2829
The Action Asset appears in your Project view, and is named "InputSystem_Actions". This is where your new configuration of actions is saved, including any changes you make to it.
2930

30-
![](images/InputSystemActionsAsset.png)<br/>
31-
*The new Actions Asset in your Project window*
31+
![](images/InputSystemActionsAsset.png)
3232

3333
## Edit project-wide actions
3434

3535
Once you have created and assigned project-wide actions, the Input System Package page in Project Settings displays the **Actions Editor** interface. Read more about how to use the [Actions Editor](ActionsEditor.md) to configure your actions.
3636

37-
![image alt text](./Images/ProjectSettingsInputActionsSimpleShot.png)
38-
*The Input System Package Project Settings after creating and assigning the default actions*
39-
4037
## The default actions
4138

4239
When you create and assign default project-wide actions using the method described above, the Action Asset comes pre-configured with some default Actions such as "Move", "Jump", and more, which suit many common app and game scenarios. They are configured to read input from the most common types of input controller such as Keyboard, Mouse, Gamepad, Touchscreen and XR.
@@ -47,7 +44,7 @@ If you’d like to delete all the default actions so that you can start from an
4744

4845
You can also delete all action maps, or reset all the actions back to the default values from the **more** (⋮) menu at the top right of the Input Actions section of the settings window, below the Project Settings window search field.
4946

50-
![The Input Actions **more** menu as displayed in the Project Settings window](images/InputActionsSettingsMoreMenu.png)
47+
![](images/InputActionsSettingsMoreMenu.png)
5148

5249
> **Note:** this **more** (⋮) menu is not available when the Actions Editor is open in a separate window, it is only present in the Project Settings window.
5350

0 commit comments

Comments
 (0)