Skip to content

Commit 1dfbda5

Browse files
author
Rene Damm
authored
DOCS: Review pass for manual (#1060).
1 parent 733ee44 commit 1dfbda5

33 files changed

+471
-442
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
inputactions
2+
playerinput
3+
inputsystemuiinputmodule
4+
gravitysensor
5+
deadzone

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

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

33
* [Creating Action Assets](#creating-input-action-assets)
44
* [Editing Action Assets](#editing-input-action-assets)
5-
* [Using Acion Assets](#using-input-action-assets)
5+
* [Using Action Assets](#using-input-action-assets)
66

7-
An Input Action Asset is an Asset containing [Input Actions](Actions.md) as well as their associated [Bindings](ActionBindings.md) and [Control Schemes](ActionBindings.md#control-schemes). These Assets are distinguished by the `.inputactions` file extension and are stored in a plain JSON format.
7+
An Input Action Asset is an Asset which contains [Input Actions](Actions.md) and their associated [Bindings](ActionBindings.md) and [Control Schemes](ActionBindings.md#control-schemes). These Assets have the `.inputactions` file extension and are stored in a plain JSON format.
88

99
## Creating Input Action Assets
1010

11-
To create an Asset containing [Input Actions](Actions.md) in Unity, right-click in the __Project__ window or go to __Assets > Create > Input Actions__ from Unity's main menu.
11+
To create an Asset that contains [Input Actions](Actions.md) in Unity, right-click in the __Project__ window or go to __Assets > Create > Input Actions__ from Unity's main menu.
1212

1313
## Editing Input Action Assets
1414

15-
To bring up the Action editor, double-click an `.inputactions` Asset in the Project Browser, or click the __Edit Asset__ button in the inspector for that Asset. You can have more than one editor window open at the same time, but not for the same Asset.
15+
To bring up the Action editor, double-click an `.inputactions` Asset in the Project Browser, or select the __Edit Asset__ button in the Inspector for that Asset. You can have more than one editor window open at the same time, but not for the same Asset.
1616

1717
![Action Editor Window](Images/MyGameActions.png)
1818

19-
The Action editor comes up as a separate window which you can also dock into Unity's main UI.
19+
The Action editor appears as a separate window, which you can also dock into Unity's main UI.
2020

21-
>__Note__: For details about how Action Maps, Actions, and Bindings work, see the documentation on [Actions](Actions.md).
21+
>__Note__: For details about how Action Maps, Actions, and Bindings work, see documentation on [Actions](Actions.md).
2222
23-
By default, Unity doesn't save edits you make in the Action Asset window when you save the Project. To save your changes, click __Save Asset__ in the window's toolbar. To discard your changes, close the window and choose __Don't Save__ when prompted. Alternatively, you can toggle auto-saving on by enabling the __Auto-Save__ checkbox in the toolbar. This saves any changes to that Asset.
23+
By default, Unity doesn't save edits you make in the Action Asset window when you save the Project. To save your changes, select __Save Asset__ in the window's toolbar. To discard your changes, close the window and choose __Don't Save__ when prompted. Alternatively, you can toggle auto-saving on by enabling the __Auto-Save__ checkbox in the toolbar. This saves any changes to that Asset.
2424

2525
>__Note__: This setting affects all `.inputactions` Assets, and persists across Unity Editor sessions.
2626
27-
The editor window is divided into three panes:
27+
The Action editor window is divided into three panes:
2828

29-
1. The left pane lists the Action Maps in the Asset. Each Map is a collection of Actions that you can enable or disable in bulk.
29+
1. The left pane lists the Action Maps in the Asset. Each Action Map is a collection of Actions that you can enable or disable in bulk.
3030
2. The middle pane contains the Actions in the currently selected Action Map, and the bindings associated with each Action.
3131
3. The right pane contains the properties of the currently selected Action or Binding.
3232

@@ -49,18 +49,16 @@ Use the following keyboard shortcuts to quickly trigger common operations:
4949

5050
![Action Maps Column](Images/ActionMapsColumn.png)
5151

52-
>__Note__: Action Map names can't contain slashes (`/`).
53-
54-
* To add a new Action Map, click the plus icon in the header of the Action Map column.
55-
* To rename an existing Action Map, either long-click the name, or right-click the Action Map and select __Rename__ from the context menu.
52+
* To add a new Action Map, select the Add (+) icon in the header of the Action Map column.
53+
* To rename an existing Action Map, either long-click the name, or right-click the Action Map and select __Rename__ from the context menu. Note that Action Map names can't contain slashes (`/`).
5654
* To delete an existing Action Map, either right-click it and select __Delete__ from the context menu, or use the Delete key (Windows) / ⌘⌫ (Mac).
5755
* To duplicate an existing Action Map, either right-click it and select __Duplicate__ from the context menu, or use Ctrl-D (Windows) / ⌘D (Mac).
5856

5957
### Editing Actions
6058

6159
![Action Column](Images/ActionColumn.png)
6260

63-
* To add a new Action, click the plus icon in the header of the Action column.
61+
* To add a new Action, select the Add (+) icon in the header of the Action column.
6462
* To rename an existing Action, either long-click the name, or right-click the Action Map and select __Rename__ from the context menu.
6563
* To delete an existing Action, either right-click it and select __Delete__ from the context menu, or use the Delete key (Windows) / ⌘⌫ (Mac).
6664
* To duplicate an existing Action, either right-click it and select __Duplicate__ from the context menu, or use Ctrl-D (Windows) / ⌘D (Mac).
@@ -71,7 +69,7 @@ If you select an Action, you can edit it's properties in the right-hand pane of
7169

7270
### Editing Bindings
7371

74-
* To add a new Binding, click the plus icon on the action you want to add it to, and select the binding type from the menu that appears.
72+
* To add a new Binding, select the Add (+) icon on the action you want to add it to, and select the binding type from the menu that appears.
7573
* To delete an existing Binding, either right-click it and select __Delete__ from the context menu, or use the Delete key (Windows) / ⌘⌫ (Mac).
7674
* To duplicate an existing Binding, either right-click it and select __Duplicate__ from the context menu, or use Ctrl-D (Windows) / ⌘D (Mac).
7775

@@ -81,39 +79,39 @@ If you select a Binding, you can edit its properties in the right-hand pane of t
8179

8280
#### Picking Controls
8381

84-
The most important property of any Binding is the [control path](Controls.md#control-paths) it's bound to. To edit it, open the __Path__ drop-down list. This pops up a Control picker window.
82+
The most important property of any Binding is the [control path](Controls.md#control-paths) it's bound to. To edit it, open the __Path__ drop-down list. This displays a Control picker window.
8583

8684
![Control Picker](Images/InputControlPicker.png)
8785

8886
In the Control picker window, you can explore a tree of Input Devices and Controls that the Input System recognizes, and bind to these Controls. Unity filters this list by the Action's [`Control Type`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_expectedControlType) property. For example, if the Control type is `Vector2`, you can only select a Control that generates two-dimensional values, like a stick.
8987

90-
The Device and Control tree is organized hierarchically from generic to specific. For example, navigate to __Gamepad__, and choose the Control path `<Gamepad>/buttonSouth`, this matches the lower action button on any gamepad. On the other hand, if you navigate to __Gamepad__, then scroll down to __More Specific Gamepads__ and select __PS4 Controller__, and then choose the Control path `<DualShockGamepad>/buttonSouth`, this only matches the "cross" button on PlayStation gamepads, and doesn't match any other gamepads.
88+
The Device and Control tree is organized hierarchically from generic to specific. For example, the __Gamepad__ Control path `<Gamepad>/buttonSouth` matches the lower action button on any gamepad. Alternatively, if you navigate to __Gamepad__ > __More Specific Gamepads__ and select __PS4 Controller__, and then choose the Control path `<DualShockGamepad>/buttonSouth`, this only matches the "Cross" button on PlayStation gamepads, and doesn't match any other gamepads.
9189

92-
Instead of browsing the tree to find the Control you want, it's easier to let the Input System listen for input. To do that, click the __Listen__ button. At first, the list of Controls is empty. Once you start clicking buttons or actuating Controls on the Devices you want to bind to, the Control picker window starts listing any Bindings that match the controls you pressed. Click any of these Bindings to select it.
90+
Instead of browsing the tree to find the Control you want, it's easier to let the Input System listen for input. To do that, select the __Listen__ button. At first, the list of Controls is empty. Once you start pressing buttons or actuating Controls on the Devices you want to bind to, the Control picker window starts listing any Bindings that match the controls you pressed. Select any of these Bindings to view them.
9391

94-
Finally, you can choose to manually edit the Binding path, instead of using the Control picker. To do that, click the __T__ button next to the Control path popup. This changes the popup to a text field, where you can enter any Binding string. This also allows you to use wildcard (`*`) characters in your Bindings. For example, you can use a Binding path such as `<Touchscreen>/touch*/press` to bind to any finger being pressed on the touchscreen, instead of manually binding to `<Touchscreen>/touch0/press`, `<Touchscreen>/touch1/press` and so on.
92+
Finally, you can choose to manually edit the Binding path, instead of using the Control picker. To do that, select the __T__ button next to the Control path popup. This changes the popup to a text field, where you can enter any Binding string. This also allows you to use wildcard (`*`) characters in your Bindings. For example, you can use a Binding path such as `<Touchscreen>/touch*/press` to bind to any finger being pressed on the touchscreen, instead of manually binding to `<Touchscreen>/touch0/press`, `<Touchscreen>/touch1/press` and so on.
9593

9694
#### Editing Composite Bindings
9795

9896
Composite Bindings are Bindings consisting of multiple parts, which form a Control together. For instance, a [2D Vector Composite](ActionBindings.md#2d-vector) uses four buttons (left, right, up, down) to simulate a 2D stick input. See the [Composite Bindings](ActionBindings.md#composite-bindings) documentation to learn more.
9997

100-
To create a Composite Binding, in the Input Action Asset editor window, click the plus icon on the Action you want to add it to, and select the Composite Binding type from the popup menu. This creates multiple Binding entries for the Action: one for the Composite as a whole, and then, one level below that, one for each Composite part. The Composite itself doesn't have a Binding path property, but its individual parts do, and you can edit these parts like any other Binding. Once you bind all the Composite's parts, the Composite can work together as if you bound a single control to the Action.
98+
To create a Composite Binding, in the Input Action Asset editor window, select the Add (+) icon on the Action you want to add it to, and select the Composite Binding type from the popup menu. This creates multiple Binding entries for the Action: one for the Composite as a whole, and then, one level below that, one for each Composite part. The Composite itself doesn't have a Binding path property, but its individual parts do, and you can edit these parts like any other Binding. Once you bind all the Composite's parts, the Composite can work together as if you bound a single control to the Action.
10199

102100
### Editing Control Schemes
103101

104102
Input Action Assets can have multiple [Control Schemes](ActionBindings.md#control-schemes), which let you enable or disable different sets of Bindings for your Actions for different types of Devices.
105103

106104
![Control Scheme Properties](Images/ControlSchemeProperties.png)
107105

108-
To see the Control Schemes in the Input Action Asset editor window, open the Control Scheme drop-down list in the top left of the window. This menu lets you add or remove Control Schemes to your Asset. If the Asset contains any Control Schemes, you can select a Control Scheme, and then the window only shows bindings that belong to that Scheme. If you select a binding, you can now pick the Control Schemes for which this binding should be active in the __Properties__ view to the left of the window. When you add a new Control Scheme, or select an existing Control Scheme, and then click __Edit Control Scheme…__, you can edit the name of the Control Scheme and which devices the Scheme should be active for.
106+
To see the Control Schemes in the Input Action Asset editor window, open the Control Scheme drop-down list in the top left of the window. This menu lets you add or remove Control Schemes to your Asset. If the Asset contains any Control Schemes, you can select a Control Scheme, and then the window only shows bindings that belong to that Scheme. If you select a binding, you can now pick the Control Schemes for which this binding should be active in the __Properties__ view to the left of the window. When you add a new Control Scheme, or select an existing Control Scheme, and then select __Edit Control Scheme…__, you can edit the name of the Control Scheme and which devices the Scheme should be active for.
109107

110108
## Using Input Action Assets
111109

112110
### Auto-generating script code for Actions
113111

114112
One of the most convenient ways to work with `.inputactions` Assets in scripts is to automatically generate a C# wrapper class for them. This removes the need to manually look up Actions and Action Maps using their names, and also provides an easier way to set up callbacks.
115113

116-
To enable this option, tick the __Generate C# Class__ checkbox in the importer properties in the Inspector of the `.inputactions` Asset, then click __Apply__.
114+
To enable this option, tick the __Generate C# Class__ checkbox in the importer properties in the Inspector of the `.inputactions` Asset, then select __Apply__.
117115

118116
![MyPlayerControls Importer Settings](Images/FireActionInputAssetInspector.png)
119117

0 commit comments

Comments
 (0)