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
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/Actions.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,14 +7,12 @@ uid: input-system-actions
7
7
8
8
For example, the purpose of an input in a game might be to make the player's character move. The device control associated with that action might be the left gamepad stick.
9
9
10
-
The association between an Action and the device controls which perform that input is a **binding**, and you can set up bindings in the [Input Actions editor](actions-editor.md). When you use Actions in your code, you do not need to refer to specific devices because the binding defines which device's controls are used to perform the action.
11
-
12
-
To use actions in your code, you must use the [Input Actions editor](actions-editor.md) to configure the mapping between the Action and one or more device controls. For example in this screenshot, the "Move" action is displayed, showing its bindings the left gamepad stick, and the keyboard's arrow keys.
10
+
To associate an action with one or more device controls, you set up input bindings in the [Input Actions Editor](actions-editor.md). Then you can refer to those actions in your code, instead of the specific devices. The input bindings define which device's controls are used to perform the action. For example this screenshot shows the "Move" action's bindings to the left gamepad stick and the keyboard's arrow keys.
13
11
14
12
<br/>
15
13
*The Actions panel of the Input Actions Editor in Project Settings*
16
14
17
-
You can then get a reference to this action in your code, and check its value, or attach a callback method to be notified when it is performed. See the [Actions Workflow page](using-actions-workflow.md) for a simple example script demonstrating this.
15
+
When you get a reference to an action in your code, you can use it to check its value, or attach a callback method to be notified when it is performed. For a simple example script demonstrating this, refer to [Workflow Overview - Actions](using-actions-workflow.md).
18
16
19
17
Actions also make it simpler to create a system that lets your players [customize their bindings at runtime](rebind-action-runtime.md), which is a common requirement for games.
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/about-responding-to-input.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,15 +25,15 @@ Once you have your actions set up, you can implement responses to those actions.
25
25
26
26
There are two main techniques you can use to respond to actions in your project. These are to either use **polling** or an **event-driven** approach.
27
27
28
-
- The **polling** approach refers to the technique of repeatedly checking the current state of your actions. Typically you do this in the `Update()` method of a `MonoBehaviour` script. See[polling actions](polling-actions.md) for further information.
28
+
- The **polling** approach refers to the technique of repeatedly checking the current state of your actions. Typically you do this in the `Update()` method of a `MonoBehaviour` script. Refer to[polling actions](polling-actions.md) for further information.
29
29
30
-
- The **event-driven** approach involves creating your own methods in code that are automatically called when an action is performed. See[Set callbacks on actions](set-callbacks-on-actions.md) for further information.
30
+
- The **event-driven** approach involves creating your own methods in code that are automatically called when an action is performed. Refer to[Set callbacks on actions](set-callbacks-on-actions.md) for further information.
31
31
32
32
For most common scenarios, especially action games where the user's input has a continuous centralized effect on an in-game character, **polling** is usually simpler and easier to implement. For other situations where input is less continuous, or directed to many different areas in your scene, an event-driven approach might be more appropriate.
33
33
34
34
## Other workflows
35
35
36
36
The Input System also allows you to read device states directly, which bypasses many of the features such as actions and bindings. This workflow is suitable for fast prototyping, or single fixed platform scenarios, but is a less flexible workflow because it bypasses some useful Input System features.
37
37
38
-
See[Read devices directly](read-devices-directly.md) for further information about this workflow.
38
+
Refer to[Read devices directly](read-devices-directly.md) for further information about this workflow.
The Input System supports multi-user management through the [`InputUser`](xref:UnityEngine.InputSystem.Users.InputUser) class. This comprises both user account management features on platforms that have these capabilities built into them (such as Xbox and PS4), as well as features to manage Device allocations to one or more local users.
8
8
9
9
> [!NOTE]
10
-
> The user management API is quite low-level in nature. The stock functionality of Player Input Manager component (see[Player Input Manager](player-input-manager-component.md)) provides an easier way to set up user management. The API described here is useful when you want more control over user management.
10
+
> The user management API is quite low-level in nature. The stock functionality of Player Input Manager component (refer to[Player Input Manager](player-input-manager-component.md)) provides an easier way to set up user management. The API described here is useful when you want more control over user management.
11
11
12
12
In the Input System, each [`InputUser`](xref:UnityEngine.InputSystem.Users.InputUser) represents a human interacting with the application. For example, you can have multiple users playing a game together on a single computer or device (local multiplayer), where each user has one or more [paired Input Devices](#device-pairing).
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/api-overview.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,20 +20,20 @@ using UnityEngine.InputSystem;
20
20
|-----|-----------|
21
21
|[`InputSystem.actions`](xref:UnityEngine.InputSystem.InputSystem)|A reference to the set of actions assigned as the [project-wide Actions](./about-project-wide-actions.md).|
22
22
|[`InputAction`](xref:UnityEngine.InputSystem.InputAction)|The class which represents an action. You can use a reference to an action to read the current value of the controls that it is bound to, or to trigger callbacks in response to input. This class corresponds to an entry in the **Actions** column of the [Input Actions editor](actions-editor.md).|
23
-
|[`InputActionMap`](xref:UnityEngine.InputSystem.InputActionMap)|The class which represents an [action map](create-edit-delete-action-maps.md). The API equivalent to an entry in the "Action Maps" column of the [Input Actions editor](actions-editor.md).|
24
-
|[`InputBinding`](xref:UnityEngine.InputSystem.InputBinding)|The relationship between an action and the specific device controls for which it receives input. For more information about Bindings and how to use them, see[bindings](bindings.md).|
23
+
|[`InputActionMap`](xref:UnityEngine.InputSystem.InputActionMap)|The class which represents an [action map](create-edit-delete-action-maps.md). The API equivalent to an entry in the **Action Maps** column of the [Input Actions editor](actions-editor.md).|
24
+
|[`InputBinding`](xref:UnityEngine.InputSystem.InputBinding)|The relationship between an action and the specific device controls for which it receives input. For more information about Bindings and how to use them, refer to[bindings](bindings.md).|
25
25
26
26
## Actions
27
27
28
28
The [`InputAction`](xref:UnityEngine.InputSystem.InputAction) class represents an action in the Input System. These are the same actions that you [create in the actions editor](actions.md).
29
29
30
-
With a reference to an action, you can then read values and state changes using eeither the [polling](polling-actions.md) or [callbacks](set-callbacks-on-actions.md) workflow.
30
+
With a reference to an action, you can then read values and state changes using either the [polling](polling-actions.md) or [callbacks](set-callbacks-on-actions.md) workflow.
31
31
32
-
Each action has a name ([`InputAction.name`](xref:UnityEngine.InputSystem.InputAction)), which must be unique within the Action Map that the Action belongs to, if any (see [`InputAction.actionMap`](xref:UnityEngine.InputSystem.InputAction)). Each Action also has a unique ID ([`InputAction.id`](xref:UnityEngine.InputSystem.InputAction)), which you can use to reference the Action. The ID remains the same even if you rename the Action.
32
+
Each action has a name ([`InputAction.name`](xref:UnityEngine.InputSystem.InputAction)), which must be unique within the action map that the action belongs to, if any (refer to [`InputAction.actionMap`](xref:UnityEngine.InputSystem.InputAction)). Each action also has a unique ID ([`InputAction.id`](xref:UnityEngine.InputSystem.InputAction)), which you can use to reference the action. The ID remains the same even if you rename the action.
33
33
34
34
## Action maps
35
35
36
-
Each Action Map has a name ([`InputActionMap.name`](xref:UnityEngine.InputSystem.InputActionMap)), which must also be unique with respect to the other Action Maps present, if any. Each Action Map also has a unique ID ([`InputActionMap.id`](xref:UnityEngine.InputSystem.InputActionMap)), which you can use to reference the Action Map. The ID remains the same even if you rename the Action Map.
36
+
Each action map has a name ([`InputActionMap.name`](xref:UnityEngine.InputSystem.InputActionMap)), which must also be unique with respect to the other action maps present, if any. Each action map also has a unique ID ([`InputActionMap.id`](xref:UnityEngine.InputSystem.InputActionMap)), which you can use to reference the action map. The ID remains the same even if you rename the action map.
37
37
38
38
With a reference to an action map, you can then read all the [`actions`](xref:UnityEngine.InputSystem.InputActionMap) which belong to that map.
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/background-behavior.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
@@ -11,7 +11,7 @@ This setting is only relevant when "Run In Background" is enabled in the [Player
11
11
In the Editor, "Run In Background" is considered to always be enabled as the player loop is kept running regardless of whether a Game View is focused or not. Also, in development players on desktop platforms, the setting is force-enabled during the build process.
12
12
13
13
> [!NOTE]
14
-
> In the editor, `Background Behavior` is further influenced by [`Play Mode Input Behavior`](#play-mode-input-behavior). See[Background and Focus Change Behavior](device-background-focus-changes.md) for a detailed breakdown. In particular, which devices are considered as [`canRunInBackground`](xref:UnityEngine.InputSystem.InputDevice) partly depends on the [`Play Mode Input Behavior`](#play-mode-input-behavior) setting.
14
+
> In the editor, `Background Behavior` is further influenced by [`Play Mode Input Behavior`](#play-mode-input-behavior). Refer to[Background and Focus Change Behavior](device-background-focus-changes.md) for a detailed breakdown. In particular, which devices are considered as [`canRunInBackground`](xref:UnityEngine.InputSystem.InputDevice) partly depends on the [`Play Mode Input Behavior`](#play-mode-input-behavior) setting.
>Compositesmustbe__stateless__. Thismeansthatyoucannotstorelocalstatethatchangesdependingontheinputbeingprocessed. For__stateful__processingonbindings, see [interactions](xref:input-system-interactions#writing-custom-interactions).
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/configure-input-from-code.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ You can set up [actions](actions.md), [bindings](introduction-to-bindings.md), a
10
10
| --- | --- |
11
11
|**[Declare stand-alone actions](declare-standalone-actions.md)**| Expose `InputAction` and `InputActionMap` fields on a `MonoBehaviour` and configure them in the **Inspector** window or in code. |
12
12
|**[Configure input from JSON](configure-input-from-json.md)**| Create or load `InputActionMap` and `InputActionAsset` instances from JSON strings at edit time or runtime. |
13
+
|**[Create actions in code](create-actions-in-code.md)**| Create and configure actions entirely in code. |
13
14
|**[Configure Bindings from code](configure-bindings-from-code.md)**| Work with `InputBinding` in code: add or remove bindings, composites, parameters, overrides, and control schemes. |
14
15
15
16
For a high-level map of the actions API (enabling, polling, callbacks), refer to [Scripting with actions API overview](api-overview.md).
You can load Actions as JSON in the form of a set of Action Maps or as a full [`InputActionAsset`](xref:UnityEngine.InputSystem.InputActionAsset). This also works at runtime in the Player.
7
+
You can load actions as JSON in the form of a set of action maps or as a full [`InputActionAsset`](xref:UnityEngine.InputSystem.InputActionAsset). This also works at runtime in the Player.
[`Input.compositionString`](https://docs.unity3d.com/ScriptReference/Input-compositionString.html)|Subscribe to the [`Keyboard.onIMECompositionChange`](xref:UnityEngine.InputSystem.Keyboard).
65
-
[`Input.imeCompositionMode`](https://docs.unity3d.com/ScriptReference/Input-imeCompositionMode.html)|Use: [`Keyboard.current.SetIMEEnabled(true)`](xref:UnityEngine.InputSystem.Keyboard)<br/>Also see:[Keyboard text input documentation](read-keyboard-text-input.md#working-with-input-from-input-method-editors).
65
+
[`Input.imeCompositionMode`](https://docs.unity3d.com/ScriptReference/Input-imeCompositionMode.html)|Use: [`Keyboard.current.SetIMEEnabled(true)`](xref:UnityEngine.InputSystem.Keyboard)<br/>Refer to[Keyboard text input documentation](read-keyboard-text-input.md#working-with-input-from-input-method-editors).
[`Input.inputString`](https://docs.unity3d.com/ScriptReference/Input-inputString.html)|Subscribe to the [`Keyboard.onTextInput`](xref:UnityEngine.InputSystem.Keyboard) event:<br/>`Keyboard.current.onTextInput += character => /* ... */;`
0 commit comments