Skip to content

Commit 0a622df

Browse files
author
Rene Damm
authored
CHANGE: Refactor/clean up some APIs and add a batch of scripting API docs (#762).
1 parent 1e926a8 commit 0a622df

File tree

119 files changed

+1745
-699
lines changed

Some content is hidden

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

119 files changed

+1745
-699
lines changed

Assets/Demo/OnScreenController/Prefabs.meta

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

Assets/Demo/SimpleDemo/SimpleController_UsingActionEventQueue.cs

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

Assets/Demo/SimpleDemo/SimpleController_UsingActionEventQueue.cs.meta

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

Assets/Demo/SimpleDevice.cs

Lines changed: 8 additions & 14 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,14 +14,10 @@ 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; }
@@ -33,16 +30,13 @@ protected override void FinishSetup()
3330
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: 1 addition & 0 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

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
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"displayName": "On-Screen Controls Sample",
3+
"description": "Demonstrates a simple setup for an on-screen joystick."
4+
}
File renamed without changes.

Assets/Demo/OnScreenController/Prefabs/Button.prefab.meta renamed to Assets/Samples/OnScreenControls/Button.prefab.meta

File renamed without changes.

0 commit comments

Comments
 (0)