Skip to content

Commit 0d23da5

Browse files
unitALGekcoh
andauthored
DOCS: Documentation edits for clarity, usability, and conformation to doc standards (#2253)
Co-authored-by: Håkan Sidenvall <[email protected]>
1 parent d78b238 commit 0d23da5

File tree

81 files changed

+1797
-1860
lines changed

Some content is hidden

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

81 files changed

+1797
-1860
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ however, it has to be formatted properly to pass verification tests.
468468
- Fixed issue of visual elements being null during editing project-wide actions in project settings which prompted console errors.
469469
- Fixed case ISX-1436 (UI TK Input Action Asset Editor - Error deleting Bindings with DeleteKey on Windows).
470470
- Fixed issue with UI Toolkit based Input Action Editor not restoring it's selected items after Domain Reload.
471-
- Fixed the [`GetHapticCapabilitiesCommand`](xref:UnityEngine.InputSystem.XR.Haptics.GetHapticCapabilitiesCommand) always failing to execute due to a mismatch in the size in bytes of the payload and the size expected by XR devices. Changed [`HapticCapabilities`](xref:UnityEngine.InputSystem.XR.Haptics.HapticCapabilities) to include all properties returned by the XR input subsystem. This makes Input System match the functionality provided by the [XR](https://docs.unity3d.com/Manual/com.unity.modules.xr.html) module's [`InputDevice.TryGetHapticCapabilities`](https://docs.unity3d.com/ScriptReference/XR.InputDevice.TryGetHapticCapabilities.html) and [`HapticCapabilities`](https://docs.unity3d.com/ScriptReference/XR.HapticCapabilities.html).
471+
- Fixed the [`GetHapticCapabilitiesCommand`](xref:UnityEngine.InputSystem.XR.Haptics.GetHapticCapabilitiesCommand) always failing to execute due to a mismatch in the size in bytes of the payload and the size expected by XR devices. Changed [`HapticCapabilities`](xref:UnityEngine.InputSystem.XR.Haptics.HapticCapabilities) to include all properties returned by the XR input subsystem. This makes Input System match the functionality provided by the [XR](https://docs.unity3d.com/Manual/com.unity.modules.xr.html) module's [`InputDevice.TryGetHapticCapabilities`](xref:UnityEngine.XR.InputDevice.TryGetHapticCapabilities(UnityEngine.XR.HapticCapabilities&)) and [`HapticCapabilities`](xref:UnityEngine.XR.HapticCapabilities).
472472
- Fixed issue where deleting a binding in the Input Action Editor would usually result in an unexpected item being selected next.
473473

474474
## [1.8.0-pre.1] - 2023-09-04
@@ -1904,7 +1904,8 @@ This release includes a number of Quality-of-Life improvements for a range of co
19041904

19051905
- **The system no longer supports processing input in __BOTH__ fixed and dynamic updates**. Instead, a choice has to be made whether to process input before each `FixedUpdate()` or before each `Update()`.
19061906
* Rationale: the existing code that supported having both updates receive input independently still had several holes and became increasingly complex and brittle. Our solution was based on not actually processing input twice but on channeling input concurrently into both the state of both updates. Together with the fact that specific inputs have to reset (and possibly accumulate) correctly with respect to their update time slices, this became increasingly hard to do right. This, together with the fact that we've come to increasingly question the value of this feature, led us to removing the capability while preserving the ability to determine where input is processed.
1907-
* NOTE: Timeslicing is NOT affected by this. You can still switch to `ProcessEventInFixedUpdates` and get events timesliced to individual `FixedUpdate` periods according to their timestamps.
1907+
> [!NOTE]
1908+
> Timeslicing is NOT affected by this. You can still switch to `ProcessEventInFixedUpdates` and get events timesliced to individual `FixedUpdate` periods according to their timestamps.
19081909
* `InputSettings.UpdateMode.ProcessEventsInBothFixedAndDynamicUpdate` has been removed.
19091910
* `InputSettings.UpdateMode.ProcessEventsInDynamicUpdateOnly` has been renamed to `InputSettings.UpdateMode.ProcessEventsInDynamicUpdate` and is now the default.
19101911
* `InputSettings.UpdateMode.ProcessEventsInFixedUpdateOnly` has been renamed to `InputSettings.UpdateMode.ProcessEventsInFixedUpdate`.
@@ -2105,9 +2106,10 @@ This release includes a number of Quality-of-Life improvements for a range of co
21052106

21062107
## [0.2.6-preview] - 2019-03-20
21072108

2108-
>NOTE: The UI code for editing actions has largely been rewritten. There may be regressions.
2109-
>NOTE: The minimum version requirement for the new input system has been bumped
2110-
to 2019.1
2109+
> [!NOTE]
2110+
> The UI code for editing actions has largely been rewritten. There may be regressions.
2111+
>
2112+
> The minimum version requirement for the new input system has been bumped to 2019.1
21112113

21122114
### Added
21132115

@@ -2185,7 +2187,8 @@ This release includes a number of Quality-of-Life improvements for a range of co
21852187

21862188
This release contains a number of fairly significant changes. The focus has been on further improving the action system to make it easier to use as well as to make it work more reliably and predictably.
21872189

2188-
>NOTE: There are some breaking changes. Please see the "Changed" section below.
2190+
> [!NOTE]
2191+
> There are some breaking changes. Please see the "Changed" section below.
21892192

21902193
### Changed
21912194

@@ -2321,10 +2324,11 @@ This release contains a number of fairly significant changes. The focus has been
23212324

23222325
## [0.1.2-preview] - 2018-12-19
23232326

2324-
NOTE: The minimum version requirement for the new input system has been bumped
2325-
to 2018.3. The previous minum requirement of 2018.2 is no longer supported.
2326-
Also, we have dropped support for the .NET 3.5 runtime. The new .NET 4
2327-
runtime is now required to use the new input system.
2327+
> [!NOTE]
2328+
> The minimum version requirement for the new input system has been bumped
2329+
> to 2018.3. The previous minum requirement of 2018.2 is no longer supported.
2330+
> Also, we have dropped support for the .NET 3.5 runtime. The new .NET 4
2331+
> runtime is now required to use the new input system.
23282332

23292333
We've started working on documentation. The current work-in-progress can be found on [GitHub](https://github.com/Unity-Technologies/InputSystem/blob/develop/Packages/com.unity.inputsystem/Documentation~/InputSystem.md).
23302334
Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,53 @@
11
---
22
uid: input-system-action-assets
33
---
4-
# Input Action Assets
4+
# Input action assets
55

6-
- [Creating Input Action Assets](#creating-input-action-assets)
7-
- [Editing Input Action Assets](#editing-input-action-assets)
8-
- [Using Input Action Assets](#using-input-action-assets)
9-
- [Type-safe C# API Generation](#type-safe-c-api-generation)
6+
An input action asset is an asset which contains a set of [input action](xref:input-system-actions) definitions and their associated [Bindings](xref:input-system-action-bindings) and [control schemes](xref:input-system-action-bindings#control-schemes). These assets have the `.inputactions` file extension and are stored in a plain JSON format.
107

11-
An Input Action Asset is an Asset which contains a set of [Input Actions](Actions.md) definitions 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.
8+
The input system creates an action asset when you set up the [default project-wide actions](xref:project-wide-actions), but you can also create new action assets directly in the Project window.
129

13-
The input system creates an Action Asset when you set up the [default project-wide actions](ProjectWideActions.md), but you can also create new Action Assets directly in the Project window.
10+
For most common scenarios, you do not need to use more than one input action asset. It is usually simpler to configure your project-wide action definition in the Project Settings window.
1411

15-
For most common scenarios, you do not need to use more than one Input Action Asset. It is usually simpler to configure your project-wide action definition in the Project Settings window.
1612

13+
## Creating input action assets
1714

18-
## Creating Input Action Assets
15+
To create an asset that contains [input actions](xref:input-system-actions) in Unity, right-click in the __Project__ window or go to __Assets > Create > Input Actions__ from Unity's main menu.
1916

20-
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.
17+
## Editing input action assets
2118

22-
## Editing Input Action Assets
19+
To open the Input Actions 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.
2320

24-
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.
21+
This Input Actions Editor is identical to the one that opens in the [Project Settings window](xref:input-system-configuring-input).
2522

26-
The Actions Editor which opens is identical to the [Actions Editor in the Project Settings window](ActionsEditor.md).
2723

24+
## Using input action assets
2825

29-
## Using Input Action Assets
3026

27+
## Type-safe C# API generation
3128

32-
## Type-safe C# API Generation
29+
Input action assets allow you to **generate a C# class** from your action definitions, so you can refer to your actions in a type-safe manner from code. This means you can avoid looking up your actions by string.
3330

34-
Input Action Assets allow you to **generate a C# class** from your action definitions, which allow you to refer to your actions in a type-safe manner from code. This means you can avoid looking up your actions by string.
31+
### Auto-generating script code for actions
3532

36-
### Auto-generating script code for Actions
33+
One of the most convenient ways to work with `.inputactions` assets in scripts is to automatically generate a C# wrapper class for them. This provides an easier way to set up callbacks and avoid manually looking up actions and action maps by name.
3734

38-
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.
35+
To enable this option, enable the __Generate C# Class__ property in the input action asset's Inspector, then select __Apply__.
3936

40-
To enable this option, tick the __Generate C# Class__ checkbox in the importer properties in the Inspector of the `.inputactions` Asset, then select __Apply__.
41-
42-
![MyPlayerControls Importer Settings](Images/FireActionInputAssetInspector.png)
37+
![The input action asset's Inspector window displays the enabled Generate C# Class property with default values for the C# class's file, name, and namespace settings.](Images/FireActionInputAssetInspector.png)
4338

4439
You can optionally choose a path name, class name, and namespace for the generated script, or keep the default values.
4540

46-
This generates a C# script that simplifies working with the Asset.
41+
This generates a C# script that simplifies working with the asset.
4742

4843
```CSharp
4944
using UnityEngine;
5045
using UnityEngine.InputSystem;
5146

52-
// IGameplayActions is an interface generated from the "gameplay" action map
53-
// we added (note that if you called the action map differently, the name of
54-
// the interface will be different). This was triggered by the "Generate Interfaces"
55-
// checkbox.
47+
// IGameplayActions is an interface generated from the newly added "gameplay"
48+
// action map, triggered by the "Generate Interfaces" checkbox. Note that if
49+
// you change the default values for the action map, the name of the interface
50+
// will be different.
5651
public class MyPlayerScript : MonoBehaviour, IGameplayActions
5752
{
5853
// MyPlayerControls is the C# class that Unity generated.
@@ -65,8 +60,8 @@ public class MyPlayerScript : MonoBehaviour, IGameplayActions
6560
if (controls == null)
6661
{
6762
controls = new MyPlayerControls();
68-
// Tell the "gameplay" action map that we want to get told about
69-
// when actions get triggered.
63+
// Tell the "gameplay" action map that we want to be
64+
// notified when actions get triggered.
7065
controls.gameplay.SetCallbacks(this);
7166
}
7267
controls.gameplay.Enable();
@@ -90,21 +85,26 @@ public class MyPlayerScript : MonoBehaviour, IGameplayActions
9085
}
9186
```
9287

93-
>__Note__: To regenerate the .cs file, right-click the .inputactions asset in the Project Browser and choose "Reimport".
88+
> [!NOTE]
89+
> To regenerate the .cs file, right-click the .inputactions asset in the Project window and choose "Reimport".
90+
91+
### Using action assets with `PlayerInput`
9492

95-
### Using Action Assets with `PlayerInput`
93+
The [Player Input](xref:input-system-player-input) component provides a convenient way to handle input for one or multiple players. You can assign your action asset to the Player Input component so that it can then automatically handle activating action maps and selecting control schemes for you.
9694

97-
The [Player Input](PlayerInput.md) component provides a convenient way to handle input for one or multiple players. You can assign your Action Asset to the Player Input component so that it can then automatically handle activating Action Maps and selecting Control Schemes for you.
95+
![The PlayerInput component appears with Player set as the Default Map and the Behavior set to Invoke Unity Events.](Images/PlayerInput.png)
9896

99-
![PlayerInput](Images/PlayerInput.png)
97+
### Modifying input action assets at runtime
10098

101-
### Modifying Input Action Assets at runtime
102-
There are several ways to modify an Input Action Asset at runtime. Any modifications that you make during Play mode to an Input Action Asset do not persist in the Input Action Asset after you exit Play mode. This means you can test your application in a realistic manner in the Editor without having to worry about inadvertently modifying the asset. For examples on how to modify an Input Action Asset, see the documentation on [Creating Actions in code](Actions.md#creating-actions-in-code) and [Changing Bindings](ActionBindings.md#changing-bindings).
99+
There are several ways to modify an input action asset at runtime. Any modifications that you make during Play mode to an input action asset do not persist in the asset after you exit Play mode. This means you can test your application in a realistic way in the Editor without having to worry about inadvertently modifying the asset. For examples on how to modify an input action asset, refer to [Create actions in code](xref:input-system-actions#create-actions-in-code) and [Change Bindings](xref:input-system-action-bindings#change-bindings).
103100

104101

105-
### The Default Actions Asset
102+
### The default actions asset
106103

107-
An asset called `DefaultInputActions.inputactions` containing a default setup of Actions comes with the Input System Package. You can reference this asset directly in your projects like any other Unity asset. However, the asset is also available in code form through the [`DefaultInputActions`](../api/UnityEngine.InputSystem.DefaultInputActions.html) class.
104+
> [!NOTE]
105+
> The default actions asset is entirely separate from the [default project-wide actions](xref:project-wide-actions). It is a legacy asset that is included in the package for backwards compatibility.
106+
107+
The Input System package provides an asset called `DefaultInputActions.inputactions` which you can reference directly in your projects like any other Unity asset. The asset is also available in code form through the [`DefaultInputActions`](xref:UnityEngine.InputSystem.DefaultInputActions) class.
108108

109109
```CSharp
110110
void Start()
@@ -116,5 +116,3 @@ void Start()
116116
actions.Enable();
117117
}
118118
```
119-
120-
> __Note:__ This default actions asset is older than, and entirely separate from the [default project-wide actions](ProjectWideActions.md). It is a legacy asset that remains included in the package for backward compatibility.

0 commit comments

Comments
 (0)