You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DOCATT-8743: Edited PlayerInput class for clarity, made more explicit
- Similar to DOCATT-8578, I merged some of the manual & API documentation for InputControl & PlayerInput classes as part of edits
- Also corrected some links to anchors that didn't exist in Sensors.md, HID.md, and Testing.md
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/Concepts.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ This page introduces the basic concepts that relate to working with the Input Sy
13
13
|[**Input Device**](SupportedDevices.html)| Often referred to just as a "**device**" within the context of input. A physical piece of hardware, such as a keyboard, gamepad, mouse, or touchscreen which allows the user to send input into Unity.|
14
14
|[**Control**](Controls.html)|The separate individual parts of an input device which each send input values into Unity. For example, a gamepad’s **controls** comprise multiple buttons, sticks and triggers, and a mouse’s controls include the two X and Y sensors on the underside, and the various buttons and scroll wheels on the top side.|
15
15
|[**Action**](Actions.html)| Actions are a high-level concept that describe individual things that a user might want to do in your game or app, such as "Jump" within a game, or "Select" in an on-screen UI. They are things a user can do in your game or app as a result of input, regardless of what device or control they use to perform it. Actions generally have conceptual names that you choose to suit your project, and should usually be verbs. For example "Run", "Jump" "Crouch", "Use", "Start", "Quit".|
16
-
|[**Action Map**](ActionsEditor.html#configure-action-maps)| Action Maps allow you to organise Actions into groups which represent specific situations where a set of actions make sense together. You can simultaneously enable or disable all Actions in an action map, so it is useful to group Actions in Action Maps by the context in which they are relevant. For example, you might have one action map for controlling a player, and another for interacting with your game's UI.|
17
-
|[**Binding**](ActionBindings.html)| A connection defined between an **Action** and specific device controls. For example, your "Move" action might have bindings to the arrow keys and WSAD keys on the keyboard, and the left stick on a joypad, and the primary 2D axis on a VR controller. Multiple bindings like this means your game can accept cross-platform input.|
16
+
|[**Action Map**](ActionsEditor.html#configure-action-maps)| Action Maps allow you to organize Actions into groups which represent specific situations where a set of actions make sense together. You can simultaneously enable or disable all Actions in an action map, so it is useful to group Actions in Action Maps by the context in which they are relevant. For example, you might have one action map for controlling a player, and another for interacting with your game's UI.|
17
+
|[**Binding**](ActionBindings.html)| A connection defined between an **Action** and specific device controls. There are two main types of bindings:<ul><li>**Normal** bindings directly bind to control(s) by means of a [control path](xref:input-system-controls#control-paths). At runtime, any path that matches one or multiple controls will feed input into the binding.</li><li>**Composite** bindings don't bind to controls themselves. Instead, they receive their input from their **Part** bindings and then return a value representing a composition of those inputs. For example, the right trigger on the gamepad can act as a strength multiplier on the value of the left stick.</li></ul>|
18
18
|[**Your Action Code**](xref:input-system-responding)| The part of your script which is executed based on the actions you have configured. In your code, you can use references to actions to either read the current value or state of the action (also known as "polling"), or set up a callback to call your own method when actions are performed.|
19
19
|[**Action Asset**](xref:input-system-action-assets)| An asset type which contains a saved configuration of Action Maps, Actions and Bindings. You can specify one Action Asset in your project as the [project-wide actions](xref:project-wide-actions), which allows you to easily reference those actions in code by using [`InputSystem.actions`](xref:UnityEngine.InputSystem.InputSystem). |
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/Devices.md
+13-10Lines changed: 13 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ To query the set of all currently present Devices, you can use [`InputSystem.dev
9
9
10
10
## Device descriptions
11
11
12
-
An [`InputDeviceDescription`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription)describes a Device. The Input System uses this primarily during the Device discovery process. When a new Device is reported (by the runtime or by the user), the report contains a Device description. Based on the description, the system then attempts to find a Device [layout](xref:input-system-layouts) that matches the description. This process is based on [Device matchers](#matching).
12
+
The Input System uses the device description defined as a [`InputDeviceDescription`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription) primarily during the Device discovery process. When a new Device is reported (by the runtime or by the user), the system then attempts to find a Device [layout](xref:input-system-layouts) that matches the Device description contained in the report. This process is based on [Device matching](#matching).
13
13
14
14
After a Device has been created, you can retrieve the description it was created from through the [`InputDevice.description`](xref:UnityEngine.InputSystem.InputDevice.description) property.
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/HID.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ The best way to resolve the situation of HIDs not working as expected is to add
28
28
29
29
## HID output
30
30
31
-
HIDs can support output (for example, to toggle lights or force feedback motors on a gamepad). Unity controls output by sending HID Output Report commands to a Device. Output reports use Device-specific data formats. To use HID Output Reports, call [`InputDevice.ExecuteCommand`](xref:UnityEngine.InputSystem.InputDevice.ExecuteCommand``1(``0@)) to send a command struct with the [`typeStatic`](../api/UnityEngine.InputSystem.LowLevel.IInputDeviceCommandInfo.html#properties) property set as `"HIDO"` to a Device. The command struct contains the Device-specific data sent out to the HID.
31
+
HIDs can support output (for example, to toggle lights or force feedback motors on a gamepad). Unity controls output by sending HID Output Report commands to a Device. Output reports use Device-specific data formats. To use HID Output Reports, call [`InputDevice.ExecuteCommand`](xref:UnityEngine.InputSystem.InputDevice.ExecuteCommand``1(``0@)) to send a command struct with the [`typeStatic`](xref:UnityEngine.InputSystem.LowLevel.IInputDeviceCommandInfo.typeStatic) property set as `"HIDO"` to a Device. The command struct contains the Device-specific data sent out to the HID.
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/Interactions.md
+26-6Lines changed: 26 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,9 +90,25 @@ You can install Interactions on [Bindings](xref:input-system-action-bindings) or
90
90
91
91
When you create Bindings for your [Actions](xref:input-system-actions), you can choose to add Interactions to the Bindings.
92
92
93
-
If you're using [project-wide actions](xref:input-system-configuring-input), or [Input Action Assets](xref:input-system-action-assets), you can add any Interaction to your Bindings in the Input Action editor. Once you [created some Bindings](xref:input-system-configuring-input#bindings), select the Binding you want to add Interactions to, so that the right pane of the window shows the properties for that Binding. Next, click on the plus icon on the __Interactions__ foldout to open a list of all available Interactions types. Choose an Interaction type to add an Interaction instance of that type. The Interaction now appears in the __Interactions__ foldout. If the Interaction has any parameters, you can edit them, as well.
93
+
If you're using [project-wide actions](xref:input-system-configuring-input), or [Input Action Assets](xref:input-system-action-assets), you can add any Interaction to your Bindings in the Input Action editor.
94
94
95
-
To remove an Interaction, click the minus button next to it. To change the [order of Interactions](#multiple-interactions-on-a-binding), click the up and down arrows.
95
+
To add an Interaction:
96
+
97
+
1.[Create some Bindings](xref:input-system-configuring-input#bindings).
98
+
99
+
2. Select the Binding you want to add Interactions to.
100
+
101
+
The right pane of the window shows the properties for that Binding.
102
+
103
+
3. Click on the plus icon on the __Interactions__ foldout to open a list of all available Interactions types.
104
+
105
+
4. Choose an Interaction type to add an Interaction instance of that type.
106
+
107
+
The Interaction now appears in the __Interactions__ foldout. If the Interaction has any parameters, you can edit them, as well.
108
+
109
+
To remove an Interaction, click the minus button next to it.
110
+
111
+
To change the [order of Interactions](#multiple-interactions-on-a-binding), click the up and down arrows.
96
112
97
113
If you create your Bindings in code, you can add Interactions like this:
Applying Interactions directly to an Action is equivalent to applying them to all Bindings for the Action. It is thus more or less a shortcut that avoids manually adding the same Interaction(s) to each of the Bindings.
108
124
109
-
If Interactions are applied __both__ to an Action and to its Bindings, then the effect is the same as if the Action's Interactions are *appended* to the list of Interactions on each of the Bindings. This means that the Binding's Interactions are applied *first*, and then the Action's Interactions are applied *after*.
125
+
If Interactions are applied __both__ to an Action and to its Bindings, then the effect is the same as if the Action's Interactions are appended to the list of Interactions on each of the Bindings. This means that the Binding's Interactions are applied first, and then the Action's Interactions are applied after.
110
126
111
127
You can add and edit Interactions on Actions in the [Input Action Assets](xref:input-system-action-assets) editor window the [same way](#interactions-applied-to-bindings) as you would do for Bindings: select an Action to Edit, then add the Interactions in the right window pane.
112
128
@@ -243,7 +259,9 @@ A [`MultiTapInteraction`](xref:UnityEngine.InputSystem.Interactions.MultiTapInte
243
259
244
260
## Writing custom Interactions
245
261
246
-
You can also write a custom Interaction to use in your Project. You can use custom Interactions in the UI and code the same way you use built-in Interactions. Add a class implementing the [`IInputInteraction`](xref:UnityEngine.InputSystem.IInputInteraction) interface, like this:
262
+
You can also write a custom Interaction to use in your project. You can use custom Interactions in the UI and code the same way you use built-in Interactions.
263
+
264
+
Add a class implementing the [`IInputInteraction`](xref:UnityEngine.InputSystem.IInputInteraction) interface, like this:
247
265
248
266
```CSharp
249
267
// Interaction which performs when you quickly move an
@@ -287,13 +305,15 @@ public class MyWiggleInteraction : IInputInteraction
287
305
}
288
306
```
289
307
290
-
Now, you need to tell the Input System about your Interaction. Call this method in your initialization code:
308
+
Register your interaction with the Input System in your initialization code:
Your new Interaction is now available in the [Input Action Asset Editor window](xref:input-system-action-assets). You can also add it in code like this:
314
+
Your new Interaction is now available in the [Input Action Asset Editor window](xref:input-system-action-assets).
0 commit comments