Skip to content

Commit 12a68c0

Browse files
RELEASE: Merge develop.
2 parents bfe42bc + 0a622df commit 12a68c0

File tree

203 files changed

+11406
-2775
lines changed

Some content is hidden

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

203 files changed

+11406
-2775
lines changed

.yamato/upm-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ platforms:
4343
image: {{ platform.image }}
4444
flavor: {{ platform.flavor}}
4545
commands:
46+
- mv ./Assets/Samples ./Packages/com.unity.inputsystem
47+
- mv ./Assets/Samples.meta ./Packages/com.unity.inputsystem
4648
- npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm
4749
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
4850
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u {{ editor.version }}

Assets/Demo/DemoControls.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ public DemoControls()
256256
},
257257
{
258258
""name"": ""submit"",
259-
""type"": ""Value"",
259+
""type"": ""Button"",
260260
""id"": ""f6c0c6e8-e423-42cc-9071-06396825f4e2"",
261-
""expectedControlType"": """",
261+
""expectedControlType"": ""Button"",
262262
""processors"": """",
263263
""interactions"": """"
264264
},

Assets/Demo/DemoControls.inputactions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@
244244
},
245245
{
246246
"name": "submit",
247-
"type": "Value",
247+
"type": "Button",
248248
"id": "f6c0c6e8-e423-42cc-9071-06396825f4e2",
249-
"expectedControlType": "",
249+
"expectedControlType": "Button",
250250
"processors": "",
251251
"interactions": ""
252252
},

Assets/Demo/SimpleDemo/SimpleController_UsingActionEventQueue.cs

Lines changed: 0 additions & 131 deletions
This file was deleted.

Assets/Demo/SimpleDemo/SimpleController_UsingEvents.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ public class SimpleController_UsingEvents : MonoBehaviour
1616
public void OnEnable()
1717
{
1818
InputSystem.onEvent +=
19-
eventPtr =>
19+
(eventPtr, device) =>
2020
{
21-
var gamepad = InputSystem.GetDeviceById(eventPtr.deviceId) as Gamepad;
21+
var gamepad = device as Gamepad;
2222
if (gamepad == null)
2323
return;
2424

Assets/Demo/SimpleDevice.cs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using UnityEngine.InputSystem.Utilities;
55
using UnityEngine;
66
using UnityEngine.InputSystem.Layouts;
7+
using UnityEngine.InputSystem.LowLevel;
78

89
public struct MyDeviceState : IInputStateTypeInfo
910
{
@@ -13,36 +14,29 @@ public struct MyDeviceState : IInputStateTypeInfo
1314
[InputControl(layout = "Axis")]
1415
public float axis1;
1516

16-
public FourCC format
17-
{
18-
get { return new FourCC('M', 'Y', 'D', 'V'); }
19-
}
17+
public FourCC format => new FourCC('M', 'Y', 'D', 'V');
2018
}
2119

2220
[InputControlLayout(stateType = typeof(MyDeviceState))]
23-
//[InputPlugin]
2421
public class MyDevice : InputDevice, IInputUpdateCallbackReceiver
2522
{
2623
public ButtonControl button1 { get; private set; }
2724
public AxisControl axis1 { get; private set; }
2825

29-
protected override void FinishSetup(InputDeviceBuilder builder)
26+
protected override void FinishSetup()
3027
{
31-
button1 = builder.GetControl<ButtonControl>(this, "button1");
32-
axis1 = builder.GetControl<AxisControl>(this, "axis1");
33-
base.FinishSetup(builder);
28+
button1 = GetChildControl<ButtonControl>("button1");
29+
axis1 = GetChildControl<AxisControl>("axis1");
30+
base.FinishSetup();
3431
}
3532

36-
public void OnUpdate(InputUpdateType updateType)
33+
public void OnUpdate()
3734
{
38-
if (updateType == InputUpdateType.Dynamic)
39-
{
40-
var isButton1Pressed = Time.frameCount % 100 == 0;
41-
if (isButton1Pressed)
42-
InputSystem.QueueStateEvent(this, new MyDeviceState {buttons = 1});
43-
else
44-
InputSystem.QueueStateEvent(this, new MyDeviceState());
45-
}
35+
var isButton1Pressed = Time.frameCount % 100 == 0;
36+
if (isButton1Pressed)
37+
InputSystem.QueueStateEvent(this, new MyDeviceState {buttons = 1});
38+
else
39+
InputSystem.QueueStateEvent(this, new MyDeviceState());
4640
}
4741

4842
public static void Initialize()

Assets/Demo/SteamController/SteamDemoController.cs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using UnityEngine.InputSystem;
55
using UnityEngine.InputSystem.Controls;
66
using UnityEngine.InputSystem.Layouts;
7+
using UnityEngine.InputSystem.LowLevel;
78
using UnityEngine.InputSystem.Utilities;
89
using UnityEngine.InputSystem.Steam;
910
#if UNITY_EDITOR
@@ -45,18 +46,18 @@ private static void RuntimeInitializeOnLoad()
4546
public ButtonControl click { get; protected set; }
4647
public ButtonControl steamExitMenu { get; protected set; }
4748

48-
protected override void FinishSetup(InputDeviceBuilder builder)
49+
protected override void FinishSetup()
4950
{
50-
base.FinishSetup(builder);
51-
move = builder.GetControl<StickControl>("move");
52-
look = builder.GetControl<Vector2Control>("look");
53-
fire = builder.GetControl<ButtonControl>("fire");
54-
jump = builder.GetControl<ButtonControl>("jump");
55-
menu = builder.GetControl<ButtonControl>("menu");
56-
steamEnterMenu = builder.GetControl<ButtonControl>("steamEnterMenu");
57-
navigate = builder.GetControl<Vector2Control>("navigate");
58-
click = builder.GetControl<ButtonControl>("click");
59-
steamExitMenu = builder.GetControl<ButtonControl>("steamExitMenu");
51+
base.FinishSetup();
52+
move = GetChildControl<StickControl>("move");
53+
look = GetChildControl<Vector2Control>("look");
54+
fire = GetChildControl<ButtonControl>("fire");
55+
jump = GetChildControl<ButtonControl>("jump");
56+
menu = GetChildControl<ButtonControl>("menu");
57+
steamEnterMenu = GetChildControl<ButtonControl>("steamEnterMenu");
58+
navigate = GetChildControl<Vector2Control>("navigate");
59+
click = GetChildControl<ButtonControl>("click");
60+
steamExitMenu = GetChildControl<ButtonControl>("steamExitMenu");
6061
}
6162

6263
protected override void ResolveSteamActions(ISteamControllerAPI api)

Assets/QA/Input_Test/IMETest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using UnityEngine;
22
using UnityEngine.InputSystem;
3+
using UnityEngine.InputSystem.LowLevel;
34
using UnityEngine.UI;
45

56
////FIXME: will not work properly when there are multiple keyboards

Assets/QA/New Controls.inputactions.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Demo/OnScreenController/Prefabs.meta renamed to Assets/Samples.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)