Skip to content

Commit 5eabba5

Browse files
committed
Merge branch 'docs-content-model-reorg' into docs/cm-reorg-controls-DOCF-6394
# Conflicts: # Packages/com.unity.inputsystem/Documentation~/predefined-interactions.md
2 parents f7c6162 + 20bab60 commit 5eabba5

12 files changed

+343
-264
lines changed

Packages/com.unity.inputsystem/Documentation~/Interactions.md

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,12 @@ uid: input-system-interactions
33
---
44
# Interactions
55

6-
- [Operation](#operation)
7-
- [Multiple Controls on an Action](#multiple-controls-on-an-action)
8-
- [Multiple Interactions on a Binding](#multiple-interactions-on-a-binding)
9-
- [Timeouts](#timeouts)
10-
- [Using Interactions](#using-interactions)
11-
- [Interactions applied to Bindings](#interactions-applied-to-bindings)
12-
- [Interactions applied to Actions](#interactions-applied-to-actions)
13-
- [Predefined Interactions](#predefined-interactions)
14-
- [Default Interaction](#default-interaction)
15-
- [Press](#press)
16-
- [Hold](#hold)
17-
- [Tap](#tap)
18-
- [SlowTap](#slowtap)
19-
- [MultiTap](#multitap)
20-
- [Writing custom Interactions](#writing-custom-interactions)
21-
22-
An Interaction represents a specific input pattern. For example, a [hold](#hold) is an Interaction that requires a Control to be held for at least a minimum amount of time.
23-
24-
Interactions drive responses on Actions. You can place them on individual Bindings or an Action as a whole, in which case they apply to every Binding on the Action. At runtime, when a particular interaction completes, this triggers the Action.
25-
26-
![Interaction Properties](Images/InteractionProperties.png)
27-
28-
6+
Use Interactions to interpret specific input patterns from Controls that define Action behavior.
7+
8+
|Topic|Description|
9+
|-----|-----------|
10+
|[Introduction to interactions](introduction-interactions.md)| Use Interactions on Bindings and Actions to read control input patterns and trigger Actions.|
11+
|[Apply interactions to Bindings](apply-interactions-bindings.md)| Apply Interactions to individual Bindings.|
12+
|[Apply Interactions to Actions](apply-interactions-actions.md)| Apply Interactions to Actions, and all the Bindings associated with that Action. |
13+
|[Predefined interactions](predefined-interactions.md)| Use the Input System's default and built-in Interactions on your Actions and Bindings.|
14+
|[Write custom interactions](write-custom-interactions.md)| Write your own custom Interactions for your Actions and Bindings.|

Packages/com.unity.inputsystem/Documentation~/TableOfContents.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@
7171
* [Input Action Assets](ActionAssets.md)
7272
* [Input Bindings](ActionBindings.md)
7373
* [Interactions](Interactions.md)
74+
* [Introduction to interactions](introduction-interactions.md)
75+
* [Apply interactions to Bindings](apply-interactions-bindings.md)
76+
* [Apply Interactions to Actions](apply-interactions-actions.md)
77+
* [Predefined interactions](predefined-interactions.md)
78+
* [Default Interactions](default-interactions.md)
79+
* [Built-in Interactions](built-in-interactions.md)
80+
* [Write custom interactions](write-custom-interactions.md)
7481
* [Devices](Devices.md)
7582
* [Controls](controls.md)
7683
* [Processors](Processors.md)

Packages/com.unity.inputsystem/Documentation~/add-duplicate-delete-binding.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,31 @@
22

33
Open the [Actions Editor window](actions-editor.md) to add, duplicate, or delete bindings.
44

5-
To add a new Binding:
5+
## Add a binding
66

7-
1. Select the Add (+) icon on the action you want to add it to
7+
To add a new binding to an action:
8+
9+
1. Select the Add (+) icon on the action.
810
2. Select the appropriate [binding type](binding-types.md) from the menu that appears.
911

10-
To delete an existing Binding:
12+
Once you have added a binding, the next step is usually to configure its [control path](./control-paths.md).
13+
14+
## Delete a binding
15+
16+
To delete an existing binding from an action:
1117

12-
1. Right-click the action
18+
1. Right-click the action.
1319
2. Select __Delete__ from the context menu.
1420

15-
To duplicate an existing Binding:
21+
## Duplicate a binding
1622

17-
1. Right-click the action
23+
To duplicate an existing binding on an action:
24+
25+
1. Right-click the action.
1826
2. Select __Duplicate__ from the context menu.
1927

28+
## Multiple bindings
29+
2030
You can add multiple bindings to an action, which is generally useful for supporting multiple types of input device. For example, in the default set of actions, the "Move" action has a binding to the left gamepad stick and the WSAD keys, which means input through any of these bindings will perform the action.
2131

2232
![The default "move" action with its multiple bindings highlighted](./Images/ActionWithMultipleBindings.png)<br/>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Apply Interactions to Actions
2+
3+
Applying Interactions directly to an Action is equivalent to applying them to all Bindings for the Action. You can use this instead of manually adding the same Interaction(s) to multiple Bindings.
4+
5+
To apply Interactions to individual Bindings, refer to [Apply Interactions to Bindings](apply-interactions-bindings.md).
6+
7+
If you apply Interactions to both an Action and its Bindings, then the effect is the same as if the Action's Interactions are on the list of Interactions on each of the Bindings. This means that the Input System applies the Binding's Interactions first, and then the Action's Interactions.
8+
9+
## Apply Interactions to Actions via the Editor
10+
11+
To apply interactions via the Input Action Editor:
12+
13+
1. Select an Action to edit, so that the right pane of the window displays the properties for that Action.
14+
1. Select the plus icon on the __Interactions__ foldout to open a list of all available Interactions types.
15+
1. Select an Interaction type to add an Interaction instance of that type. The Interaction now appears in the __Interactions__ foldout.
16+
1. If the Interaction has any parameters, you can now edit them at this stage.
17+
18+
## Apply Interactions to Actions via code
19+
20+
If you create your Actions in code, you can add Interactions like this:
21+
22+
```CSharp
23+
var Action = new InputAction(Interactions: "tap(duration=0.8)");
24+
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Apply Interactions to Bindings
2+
3+
When you create Bindings for your [Actions](actions.md), you can choose to add Interactions to the Bindings via the Editor, or via code.
4+
5+
To apply Interactions to all Bindings on an Action, refer to [Apply Interactions to Actions](apply-interactions-actions.md).
6+
7+
## Apply Interactions to Bindings via the Editor
8+
9+
If you're using [project-wide actions](ActionsEditor.md), or [Input Action Assets](ActionAssets.md), you can add any Interaction to your Bindings via the Input Action editor.
10+
11+
1. Once you have [created some Bindings](ActionsEditor.md#bindings), select the Binding you want to add Interactions to, so that the right pane of the window displays the properties for that Binding.
12+
1. Select the plus icon on the __Interactions__ foldout to open a list of all available Interactions types.
13+
1. Select an Interaction type to add an Interaction instance of that type. The Interaction now appears in the __Interactions__ foldout.
14+
1. If the Interaction has any parameters, you can now edit them at this stage.
15+
16+
![Binding Processors](Images/BindingProcessors.png)
17+
18+
To remove an Interaction, select the minus (-) button next to it. To change the [order of Interactions](introduction-interactions.md#multiple-interactions-on-a-binding), select the up and down arrows.
19+
20+
## Apply Interactions to Bindings via code
21+
22+
To add Interactions to Bindings that you created in code, you can use the following code sample as a template:
23+
24+
```CSharp
25+
var Action = new InputAction();
26+
action.AddBinding("<Gamepad>/leftStick")
27+
.WithInteractions("tap(duration=0.8)");
28+
```

0 commit comments

Comments
 (0)