Skip to content

Commit 4f9c4b2

Browse files
authored
Merge branch 'develop' into isxb-656-fix-for-auto-schemes-switching-with-onscreen-components
2 parents fae509c + 43efc3b commit 4f9c4b2

Some content is hidden

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

43 files changed

+4739
-429
lines changed

.github/pull_request_template.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
### Description
22

3-
_Please fill this section with a description what the pull request is trying to address._
3+
_Please fill this section with a description what the pull request is trying to address and what changes were made._
44

5-
### Changes made
65

7-
_Please write down a short description of what changes were made._
8-
9-
### Testing
6+
### Testing status & QA
107

118
_Please describe the testing already done by you and what testing you request/recommend QA to execute. If you used or created any testing project please link them here too for QA._
129

13-
### Risk
10+
### Overall Product Risks
11+
12+
_Please rate the potential complexity and halo effect from low to high for the reviewers. Note down potential risks to specific Editor branches if any._
13+
14+
- Complexity:
15+
- Halo Effect:
16+
17+
### Comments to reviewers
1418

15-
_Please describe the potential risks of your changes for the reviewers._
19+
_Please describe any additional information such as what to focus on, or historical info for the reviewers._
1620

1721
### Checklist
1822

.yamato/config.metadata

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,37 @@ platforms_nix:
3636
type: Unity::VM::osx
3737
image: package-ci/macos-13:default
3838
flavor: m1.mac
39+
instabilities_run: sh ./run_standalone_instability_detection-latest.sh macos 0.5.1 || exit 0
3940
- name: mac_standalone
4041
type: Unity::VM::osx
4142
image: package-ci/macos-13:default
4243
flavor: m1.mac
44+
instabilities_run: sh ./run_standalone_instability_detection-latest.sh macos 0.5.1 || exit 0
4345
runtime: StandaloneOSX
4446
- name: mac_standalone_il2cpp
4547
type: Unity::VM::osx
4648
image: package-ci/macos-13:default
4749
flavor: m1.mac
50+
instabilities_run: sh ./run_standalone_instability_detection-latest.sh macos 0.5.1 || exit 0
4851
runtime: StandaloneOSX
4952
scripting-backend: Il2Cpp
5053
installscript: unity-downloader-cli -c editor -c StandaloneSupport-IL2CPP --wait --fast -u
5154
- name: linux
5255
type: Unity::VM
5356
image: package-ci/ubuntu-20.04:v4.50.0
5457
flavor: b1.large
58+
instabilities_run: sh ./run_standalone_instability_detection-latest.sh ubuntu 0.5.1 || exit 0
5559
- name: linux_standalone
5660
type: Unity::VM
5761
image: package-ci/ubuntu-20.04:v4.50.0
5862
flavor: b1.large
63+
instabilities_run: sh ./run_standalone_instability_detection-latest.sh ubuntu 0.5.1 || exit 0
5964
runtime: StandaloneLinux64
6065
- name: linux_standalone_il2cpp
6166
type: Unity::VM
6267
image: package-ci/ubuntu-20.04:v4.50.0
6368
flavor: b1.large
69+
instabilities_run: sh ./run_standalone_instability_detection-latest.sh ubuntu 0.5.1 || exit 0
6470
runtime: StandaloneLinux64
6571
scripting-backend: Il2Cpp
6672
installscript: unity-downloader-cli -c editor -c StandaloneSupport-IL2CPP --wait --fast -u
@@ -72,4 +78,10 @@ ios_and_tvos_macos_bokken_image: package-ci/macos-13:v4.50.0
7278

7379
test_category:
7480
- name: performance
75-
- name: all
81+
- name: all
82+
83+
instabilities_install_win: curl -s https://artifactory.prd.it.unity3d.com/artifactory/automation-and-tooling/infrastructure-instability-detection/standalone/setup/run_standalone_instability_detection-latest.bat --output run_standalone_instability_detection-latest.bat --retry 5 || exit 0
84+
instabilities_run_win: run_standalone_instability_detection-latest.bat 0.5.1 || exit 0
85+
86+
instabilities_install_nix: curl -s https://artifactory.prd.it.unity3d.com/artifactory/automation-and-tooling/infrastructure-instability-detection/standalone/setup/run_standalone_instability_detection-latest.sh --output run_standalone_instability_detection-latest.sh --retry 5 || exit 0
87+
instabilities_run_mac: sh ./run_standalone_instability_detection-latest.sh macos 0.5.1 || exit 0

.yamato/upm-ci.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
- move /Y .\Packages\com.unity.inputsystem\Samples.meta .\Assets
3535
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
3636
- ./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 {% endif %} --api-profile=NET_4_6 {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} --report-performance-data --performance-project-id=InputSystem
37+
after:
38+
- {{ instabilities_install_win }}
39+
- {{ instabilities_run_win }}
3740
artifacts:
3841
UTR_Output.zip:
3942
paths:
@@ -72,6 +75,9 @@
7275
- mv ./Packages/com.unity.inputsystem/Samples.meta ./Assets
7376
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
7477
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "mac" %} --suite=editor {% endif %} {% if platform.name == "linux" %} --suite=editor {% endif %} {% if category.name == "performance" %} --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 %} --report-performance-data --performance-project-id=InputSystem
78+
after:
79+
- {{ instabilities_install_nix }}
80+
- {{ platform.instabilities_run }}
7581
artifacts:
7682
UTR_Output.zip:
7783
paths:
@@ -93,6 +99,9 @@ build_ios_{{ editor.version }}_{{ category.name }}:
9399
- {{ unity_downloader_install }}
94100
- unity-downloader-cli -c Editor -c iOS -u {{ editor.version }} --fast --wait
95101
- ./utr --suite=playmode {% if category.name == "performance" %} --category=Performance {% endif %} --platform=iOS --editor-location=.Editor --testproject=. --player-save-path=build/players --artifacts_path=build/logs --build-only --report-performance-data --performance-project-id=InputSystem
102+
after:
103+
- {{ instabilities_install_nix }}
104+
- {{ instabilities_run_mac }}
96105
artifacts:
97106
players:
98107
paths:
@@ -113,7 +122,10 @@ run_ios_{{ editor.version }}_{{ category.name }}:
113122
- .yamato/upm-ci.yml#build_ios_{{ editor.version }}_{{ category.name }}
114123
commands:
115124
- {{ utr_install_nix }}
116-
- ./utr --suite=playmode {% if category.name == "performance" %} --category=Performance {% endif %} --platform=iOS --player-load-path=build/players --artifacts_path=build/test-results --report-performance-data --performance-project-id=InputSystem
125+
- ./utr --suite=playmode {% if category.name == "performance" %} --category=Performance {% endif %} --platform=iOS --player-load-path=build/players --artifacts_path=build/test-results --report-performance-data --performance-project-id=InputSystem
126+
after:
127+
- {{ instabilities_install_nix }}
128+
- {{ instabilities_run_mac }}
117129
artifacts:
118130
logs:
119131
paths:
@@ -131,6 +143,9 @@ build_tvos_{{ editor.version }}:
131143
- {{ unity_downloader_install }}
132144
- unity-downloader-cli -c Editor -c AppleTV -u {{ editor.version }} --fast --wait
133145
- ./utr --suite=playmode --platform=tvOS --editor-location=.Editor --testproject=. --player-save-path=build/players --artifacts_path=build/logs --build-only --report-performance-data --performance-project-id=InputSystem
146+
after:
147+
- {{ instabilities_install_nix }}
148+
- {{ instabilities_run_mac }}
134149
artifacts:
135150
players:
136151
paths:
@@ -151,6 +166,9 @@ run_tvos_{{ editor.version }}:
151166
commands:
152167
- {{ utr_install_nix }}
153168
- ./utr --suite=playmode --platform=tvOS --player-load-path=build/players --artifacts_path=build/test-results --report-performance-data --performance-project-id=InputSystem
169+
after:
170+
- {{ instabilities_install_nix }}
171+
- {{ instabilities_run_mac }}
154172
artifacts:
155173
logs:
156174
paths:
@@ -169,6 +187,9 @@ build_android_{{ editor.version }}_{{ backend.name }}_{{ category.name }}:
169187
- {{ unity_downloader_install }}
170188
- unity-downloader-cli -c Editor -c Android -u {{ editor.version }} --fast --wait
171189
- ./utr --suite=playmode {% if category.name == "performance" %} --category=Performance {% endif %} --platform=Android --editor-location=.Editor --testproject=. --player-save-path=build/players --artifacts_path=build/logs --scripting-backend={{ backend.name }} --build-only --repository --performance-project-id=InputSystem
190+
after:
191+
- {{ instabilities_install_win }}
192+
- {{ instabilities_run_win }}
172193
artifacts:
173194
players:
174195
paths:
@@ -201,7 +222,9 @@ run_android_{{ editor.version }}_{{ backend.name }}_{{ category.name }}:
201222
after:
202223
- start %ANDROID_SDK_ROOT%\platform-tools\adb.exe connect %BOKKEN_DEVICE_IP%
203224
- if not exist build\test-results mkdir build\test-results
204-
- powershell %ANDROID_SDK_ROOT%\platform-tools\adb.exe logcat -d > build/test-results/device_log.txt
225+
- powershell %ANDROID_SDK_ROOT%\platform-tools\adb.exe logcat -d > build/test-results/device_log.txt
226+
- {{ instabilities_install_win }}
227+
- {{ instabilities_run_win }}
205228
# Set uploadable artifact paths
206229
artifacts:
207230
logs:

Assets/Samples/InGameHints/InGameHintsActions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
4-
// version 1.11.2
4+
// version 1.11.3
55
// from Assets/Samples/InGameHints/InGameHintsActions.inputactions
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

Assets/Samples/SimpleDemo/SimpleControls.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
4-
// version 1.11.2
4+
// version 1.11.3
55
// from Assets/Samples/SimpleDemo/SimpleControls.inputactions
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

Assets/Tests/InputSystem/CorePerformanceTests.cs

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections;
23
using System.Collections.Generic;
34
using UnityEngine.InputSystem;
45
using UnityEngine.InputSystem.LowLevel;
@@ -1100,4 +1101,103 @@ public void Performance_OptimizedControls_ReadingPose4kTimes(OptimizationTestTyp
11001101
}
11011102

11021103
#endif
1104+
1105+
#if UNITY_2022_3_OR_NEWER
1106+
1107+
// All the profiler markers in the package code.
1108+
// Needed for the tests below.
1109+
string[] allInputSystemProfilerMarkers =
1110+
{
1111+
"InputUpdate",
1112+
"InputSystem.onBeforeUpdate",
1113+
"InputSystem.onAfterUpdate",
1114+
"PreUpdate.NewInputUpdate",
1115+
"PreUpdate.InputForUIUpdate",
1116+
"FixedUpdate.NewInputFixedUpdate"
1117+
};
1118+
1119+
[PrebuildSetup(typeof(ProjectWideActionsBuildSetup))]
1120+
[PostBuildCleanup(typeof(ProjectWideActionsBuildSetup))]
1121+
[UnityTest, Performance]
1122+
[Category("Performance")]
1123+
public IEnumerator Performance_MeasureInputSystemFrameTimeWithProfilerMarkers_FPS()
1124+
{
1125+
var keyboard = InputSystem.AddDevice<Keyboard>();
1126+
var mouse = InputSystem.AddDevice<Mouse>();
1127+
1128+
var moveAction = InputSystem.actions.FindAction("Move");
1129+
var lookAction = InputSystem.actions.FindAction("Look");
1130+
var attackAction = InputSystem.actions.FindAction("Attack");
1131+
var jumpAction = InputSystem.actions.FindAction("Jump");
1132+
var sprintAction = InputSystem.actions.FindAction("Sprint");
1133+
1134+
int performedCallCount = 0;
1135+
1136+
moveAction.performed += context => {
1137+
performedCallCount++;
1138+
};
1139+
1140+
lookAction.performed += context => {
1141+
performedCallCount++;
1142+
};
1143+
1144+
attackAction.performed += context => {
1145+
performedCallCount++;
1146+
};
1147+
1148+
jumpAction.performed += context => {
1149+
performedCallCount++;
1150+
};
1151+
1152+
sprintAction.performed += context => {
1153+
performedCallCount++;
1154+
};
1155+
1156+
using (Measure.ProfilerMarkers(allInputSystemProfilerMarkers))
1157+
{
1158+
Press(keyboard.wKey, queueEventOnly: true);
1159+
1160+
for (int i = 0; i < 500; ++i)
1161+
{
1162+
if (i % 60 == 0)
1163+
{
1164+
PressAndRelease(keyboard.aKey, queueEventOnly: true);
1165+
PressAndRelease(keyboard.sKey, queueEventOnly: true);
1166+
PressAndRelease(keyboard.dKey, queueEventOnly: true);
1167+
1168+
PressAndRelease(keyboard.leftShiftKey, queueEventOnly: true);
1169+
1170+
PressAndRelease(keyboard.spaceKey, queueEventOnly: true);
1171+
}
1172+
1173+
Click(mouse.leftButton, queueEventOnly: true);
1174+
1175+
//mouse movements for higher polling mice
1176+
for (int j = 0; j < 99; ++j)
1177+
{
1178+
Move(mouse.position, new Vector2(i + j, i + j), queueEventOnly: true);
1179+
}
1180+
1181+
InputSystem.Update();
1182+
1183+
yield return null;
1184+
}
1185+
}
1186+
}
1187+
1188+
[PrebuildSetup(typeof(ProjectWideActionsBuildSetup))]
1189+
[PostBuildCleanup(typeof(ProjectWideActionsBuildSetup))]
1190+
[UnityTest, Performance]
1191+
[Category("Performance")]
1192+
public IEnumerator Performance_MeasureInputSystemFrameTimeWithProfilerMarkers_DoingNothing()
1193+
{
1194+
yield return Measure.Frames()
1195+
.WarmupCount(30)
1196+
.DontRecordFrametime()
1197+
.MeasurementCount(500)
1198+
.ProfilerMarkers(allInputSystemProfilerMarkers)
1199+
.Run();
1200+
}
1201+
1202+
#endif
11031203
}

Assets/Tests/InputSystem/CoreTests_Actions.cs

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -12405,99 +12405,4 @@ public void Actions_ActionMapDisabledDuringOnAfterSerialization()
1240512405
Assert.That(map.enabled, Is.True);
1240612406
Assert.That(map.FindAction("MyAction", true).enabled, Is.True);
1240712407
}
12408-
12409-
// ResetDevice wasn't properly clearly Composite key state, i.e. BindingState.pressTime
12410-
// https://jira.unity3d.com/browse/ISXB-746
12411-
[Test]
12412-
[TestCase(false)]
12413-
[TestCase(true)]
12414-
[Category("Actions")]
12415-
public void Actions_CompositeBindingResetWhenResetDeviceCalledWhileExecutingAction(bool useTwoModifierComposite)
12416-
{
12417-
var keyboard = InputSystem.AddDevice<Keyboard>();
12418-
bool actionPerformed;
12419-
12420-
// Enables "Modifier must be pressed first" behavior on all Composite Bindings
12421-
InputSystem.settings.shortcutKeysConsumeInput = true;
12422-
12423-
const string modifier1 = "<Keyboard>/shift";
12424-
const string modifier2 = "<Keyboard>/ctrl";
12425-
const string key = "<Keyboard>/F1";
12426-
12427-
var map = new InputActionMap();
12428-
var resetAction = map.AddAction("resetAction");
12429-
12430-
if (!useTwoModifierComposite)
12431-
{
12432-
resetAction.AddCompositeBinding("OneModifier")
12433-
.With("Modifier", modifier1)
12434-
.With("Binding", key);
12435-
}
12436-
else
12437-
{
12438-
resetAction.AddCompositeBinding("TwoModifiers")
12439-
.With("Modifier1", modifier1)
12440-
.With("Modifier2", modifier2)
12441-
.With("Binding", key);
12442-
}
12443-
12444-
resetAction.performed += (InputAction.CallbackContext ctx) =>
12445-
{
12446-
// Disable the Keyboard while action is being performed.
12447-
// This simulates an "OnFocusLost" event occurring while processing the Action, e.g. when switching primary displays or moving the main window
12448-
actionPerformed = true;
12449-
InputSystem.s_Manager.EnableOrDisableDevice(keyboard.device, false, InputManager.DeviceDisableScope.TemporaryWhilePlayerIsInBackground);
12450-
};
12451-
12452-
map.Enable();
12453-
12454-
actionPerformed = false;
12455-
Press(keyboard.leftShiftKey);
12456-
Press(keyboard.leftCtrlKey);
12457-
Press(keyboard.f1Key);
12458-
12459-
Assert.IsTrue(actionPerformed);
12460-
12461-
// Re enable the Keyboard (before keys are released) and execute Action again
12462-
InputSystem.s_Manager.EnableOrDisableDevice(keyboard.device, true, InputManager.DeviceDisableScope.TemporaryWhilePlayerIsInBackground);
12463-
12464-
actionPerformed = false;
12465-
Release(keyboard.leftShiftKey);
12466-
Release(keyboard.leftCtrlKey);
12467-
Release(keyboard.f1Key);
12468-
12469-
Press(keyboard.leftCtrlKey);
12470-
Press(keyboard.leftShiftKey);
12471-
Press(keyboard.f1Key);
12472-
12473-
Assert.IsTrue(actionPerformed);
12474-
12475-
actionPerformed = false;
12476-
Release(keyboard.leftCtrlKey);
12477-
Release(keyboard.leftShiftKey);
12478-
Release(keyboard.f1Key);
12479-
12480-
// Re enable the Keyboard (after keys are released) and execute Action one more time
12481-
InputSystem.s_Manager.EnableOrDisableDevice(keyboard.device, true, InputManager.DeviceDisableScope.TemporaryWhilePlayerIsInBackground);
12482-
12483-
Press(keyboard.leftCtrlKey);
12484-
Press(keyboard.leftShiftKey);
12485-
Press(keyboard.f1Key);
12486-
12487-
Assert.IsTrue(actionPerformed);
12488-
12489-
actionPerformed = false;
12490-
Press(keyboard.leftShiftKey);
12491-
Press(keyboard.leftCtrlKey);
12492-
Press(keyboard.f1Key);
12493-
12494-
// Re enable the Keyboard (before keys are released) and verify Action isn't triggered when Key pressed first
12495-
InputSystem.s_Manager.EnableOrDisableDevice(keyboard.device, true, InputManager.DeviceDisableScope.TemporaryWhilePlayerIsInBackground);
12496-
12497-
Press(keyboard.f1Key);
12498-
Press(keyboard.leftCtrlKey);
12499-
Press(keyboard.leftShiftKey);
12500-
12501-
Assert.IsFalse(actionPerformed);
12502-
}
1250312408
}

0 commit comments

Comments
 (0)