Skip to content

Commit 7beea86

Browse files
authored
Merge branch 'develop' into use-penstate-displayIndex
2 parents d090e35 + 94c260e commit 7beea86

File tree

57 files changed

+4769
-360
lines changed

Some content is hidden

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

57 files changed

+4769
-360
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

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.1
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.1
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/CoreTests_Analytics.cs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,55 @@ public void Analytics_ShouldReportPlayerInputManagerData()
663663
}
664664
}
665665

666+
[Test]
667+
[Category("Analytics")]
668+
public void Analytics_ShouldReportCodeAuthoringAnalytic()
669+
{
670+
CollectAnalytics(InputExitPlayModeAnalytic.kEventName);
671+
672+
// NOTE: We do not want to trigger entering/exiting play-mode for this small data-sanity check
673+
// so just stick to triggering it explicitly. A better test would have been an editor test
674+
// going in and out of play-mode for real but not clear if this is really possible.
675+
676+
// Pretend we are entering play-mode
677+
InputExitPlayModeAnalytic.OnPlayModeStateChange(PlayModeStateChange.ExitingEditMode);
678+
InputExitPlayModeAnalytic.OnPlayModeStateChange(PlayModeStateChange.EnteredPlayMode);
679+
680+
// Assert no data received
681+
Assert.That(sentAnalyticsEvents.Count, Is.EqualTo(0));
682+
683+
// Pretend we are exiting play-mode
684+
InputExitPlayModeAnalytic.OnPlayModeStateChange(PlayModeStateChange.ExitingPlayMode);
685+
InputExitPlayModeAnalytic.OnPlayModeStateChange(PlayModeStateChange.EnteredEditMode);
686+
687+
// Assert: Data received
688+
Assert.That(sentAnalyticsEvents.Count, Is.EqualTo(1));
689+
Assert.That(sentAnalyticsEvents[0].name, Is.EqualTo(InputExitPlayModeAnalytic.kEventName));
690+
Assert.That(sentAnalyticsEvents[0].data, Is.TypeOf<InputExitPlayModeAnalytic.Data>());
691+
692+
var data0 = (InputExitPlayModeAnalytic.Data)sentAnalyticsEvents[0].data;
693+
Assert.That(data0.uses_code_authoring, Is.False);
694+
695+
// Pretend we are entering play-mode
696+
InputExitPlayModeAnalytic.OnPlayModeStateChange(PlayModeStateChange.ExitingEditMode);
697+
InputExitPlayModeAnalytic.OnPlayModeStateChange(PlayModeStateChange.EnteredPlayMode);
698+
699+
var action = new InputAction("Dance");
700+
action.AddBinding("<Keyboard>/Space");
701+
702+
// Pretend we are exiting play-mode
703+
InputExitPlayModeAnalytic.OnPlayModeStateChange(PlayModeStateChange.ExitingPlayMode);
704+
InputExitPlayModeAnalytic.OnPlayModeStateChange(PlayModeStateChange.EnteredEditMode);
705+
706+
// Assert: Data received
707+
Assert.That(sentAnalyticsEvents.Count, Is.EqualTo(2));
708+
Assert.That(sentAnalyticsEvents[1].name, Is.EqualTo(InputExitPlayModeAnalytic.kEventName));
709+
Assert.That(sentAnalyticsEvents[1].data, Is.TypeOf<InputExitPlayModeAnalytic.Data>());
710+
711+
var data1 = (InputExitPlayModeAnalytic.Data)sentAnalyticsEvents[1].data;
712+
Assert.That(data1.uses_code_authoring, Is.True);
713+
}
714+
666715
#if UNITY_INPUT_SYSTEM_ENABLE_UI
667716
[Test]
668717
[Category("Analytics")]

Assets/Tests/InputSystem/CoreTests_Devices.cs

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4162,13 +4162,40 @@ public void Devices_RemovingAndReaddingDevice_DoesNotAllocateMemory()
41624162
recorder.CollectFromAllThreads();
41634163
#endif
41644164

4165-
// We expect a single allocation for each call to ReportNewInputDevice when there is one disconnected device
4166-
//
4167-
int numberOfRepeats = 2;
4168-
int numberOfDisconnectedDevices = 1;
4169-
int numberOfCallsToReportNewInputDevicePerRun = 2;
4170-
int expectedAllocations = numberOfRepeats * numberOfDisconnectedDevices * numberOfCallsToReportNewInputDevicePerRun;
4171-
Assert.AreEqual(expectedAllocations, recorder.sampleBlockCount);
4165+
// No allocations are expected.
4166+
Assert.AreEqual(0, recorder.sampleBlockCount);
4167+
}
4168+
4169+
// Regression test to cover having null descriptor fields for a device. Some non-desktop gamepad device types do this.
4170+
[Test]
4171+
[Category("Devices")]
4172+
public void Devices_RemovingAndReaddingDeviceWithNullDescriptorFields_DoesNotThrow()
4173+
{
4174+
// InputDeviceDescription.ToJson writes empty string fields and not null values, whereas reporting a device via an incomplete description string will fully omit the fields.
4175+
string description = @"{
4176+
""type"": ""Gamepad"",
4177+
""product"": ""TestProduct""
4178+
}";
4179+
4180+
var deviceId = runtime.ReportNewInputDevice(description);
4181+
InputSystem.Update();
4182+
4183+
// "Unplug" device.
4184+
var removeEvent1 = DeviceRemoveEvent.Create(deviceId);
4185+
InputSystem.QueueEvent(ref removeEvent1);
4186+
InputSystem.Update();
4187+
4188+
// "Plug" it back in.
4189+
deviceId = runtime.ReportNewInputDevice(description);
4190+
InputSystem.Update();
4191+
4192+
// Repeat that sequence.
4193+
var removeEvent2 = DeviceRemoveEvent.Create(deviceId);
4194+
InputSystem.QueueEvent(ref removeEvent2);
4195+
InputSystem.Update();
4196+
4197+
runtime.ReportNewInputDevice(description);
4198+
InputSystem.Update();
41724199
}
41734200

41744201
[Test]

Assets/Tests/InputSystem/InputActionCodeGeneratorActions.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.1
4+
// version 1.11.3
55
// from Assets/Tests/InputSystem/InputActionCodeGeneratorActions.inputactions
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

Assets/Tests/InputSystem/Plugins/UITests.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3876,8 +3876,8 @@ public IEnumerator UI_WhenCursorIsLockedToScreenCenter_PointerEnterAndExitEvents
38763876
#if UNITY_2022_3_OR_NEWER // displayIndex is only available from 2022.3 onwards
38773877

38783878
[UnityTest]
3879-
#if UNITY_TVOS
3880-
[Ignore("Failing on tvOS https://jira.unity3d.com/browse/ISX-448")]
3879+
#if UNITY_TVOS || UNITY_ANDROID
3880+
[Ignore("Failing on TVOS & Android https://jira.unity3d.com/browse/ISX-2029")]
38813881
#endif
38823882
public IEnumerator UI_DisplayIndexMatchesDisplayWithTouchscreenOnScreenSpaceCanvas()
38833883
{
@@ -3927,9 +3927,8 @@ public IEnumerator UI_DisplayIndexMatchesDisplayWithTouchscreenOnScreenSpaceCanv
39273927
}
39283928

39293929
[UnityTest]
3930-
#if UNITY_TVOS
3931-
[Ignore("Failing on tvOS https://jira.unity3d.com/browse/ISX-448")]
3932-
#else
3930+
#if UNITY_TVOS || UNITY_ANDROID
3931+
[Ignore("Failing on TVOS & Android https://jira.unity3d.com/browse/ISX-2029")]
39333932
#endif
39343933
public IEnumerator UI_DisplayIndexMatchesDisplayWithTouchscreenOnOverlayCanvas()
39353934
{
@@ -3980,8 +3979,8 @@ public IEnumerator UI_DisplayIndexMatchesDisplayWithTouchscreenOnOverlayCanvas()
39803979
}
39813980

39823981
[UnityTest]
3983-
#if UNITY_TVOS
3984-
[Ignore("Failing on tvOS https://jira.unity3d.com/browse/ISX-448")]
3982+
#if UNITY_TVOS || UNITY_ANDROID
3983+
[Ignore("Failing on TVOS & Android https://jira.unity3d.com/browse/ISX-2029")]
39853984
#endif
39863985
public IEnumerator UI_DisplayIndexMatchesDisplayWithMouseOnScreenSpaceCanvas()
39873986
{
@@ -4032,6 +4031,9 @@ public IEnumerator UI_DisplayIndexMatchesDisplayWithMouseOnScreenSpaceCanvas()
40324031
}
40334032

40344033
[UnityTest]
4034+
#if UNITY_ANDROID
4035+
[Ignore("Failing on Android https://jira.unity3d.com/browse/ISX-2029")]
4036+
#endif
40354037
public IEnumerator UI_DisplayIndexMatchesDisplayWithMouseOnOverlayCanvas()
40364038
{
40374039
// Setup the Test Scene
@@ -4082,8 +4084,8 @@ public IEnumerator UI_DisplayIndexMatchesDisplayWithMouseOnOverlayCanvas()
40824084
}
40834085

40844086
[UnityTest]
4085-
#if UNITY_TVOS
4086-
[Ignore("Failing on tvOS https://jira.unity3d.com/browse/ISX-448")]
4087+
#if UNITY_TVOS || UNITY_ANDROID
4088+
[Ignore("Failing on TVOS & Android https://jira.unity3d.com/browse/ISX-2029")]
40874089
#endif
40884090
public IEnumerator UI_DisplayIndexMatchesDisplayMultiplePointers()
40894091
{

0 commit comments

Comments
 (0)