Skip to content

Commit 87c7ca1

Browse files
committed
WIP for Setting up input, actions section, DOCF-5905
1 parent eed4077 commit 87c7ca1

File tree

6 files changed

+56
-76
lines changed

6 files changed

+56
-76
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
# About action assets
3+
4+
The Input System stores your configuration of [Input Actions](Actions.md) and their associated [Bindings](ActionBindings.md), [Action Maps](ActionsEditor.html#configure-action-maps) and [Control Schemes](ActionBindings.md#control-schemes) in an [Action Asset](ActionAssets.md) file. These Assets have the `.inputactions` file extension and are stored in a plain JSON format.
5+
6+
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.
7+
8+
For most common scenarios, you do not need to use more than one Input Action Asset. This is because an Action Asset can contain multiple [Action Maps](ActionsEditor.html#configure-action-maps), which each containing a set of actions relevant to the various parts of your project (such as UI navigation, gameplay, etc).
9+
10+
## Project-Wide Actions
11+
12+
You can assign an individual Action Asset to be available "project-wide", which means the actions within that asset are available more conveniently through the Input System API without needing to set up references to the asset.
13+
14+
When you [assign an Action Asset as project-wide](assign-project-wide-actions.md), it also becomes automatically [preloaded](https://docs.unity3d.com/ScriptReference/PlayerSettings.GetPreloadedAssets.html) when your app starts up, and is kept available until it terminates.
15+
16+
Unless you have specific project requirements that require more than one Action Asset, the recommended workflow is to use a single Action Asset assigned as the project-wide actions.
17+
18+
## Modifying Input Action Assets at runtime
19+
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).
20+
21+

Packages/com.unity.inputsystem/Documentation~/action-assets.md

Lines changed: 12 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,17 @@ uid: input-system-action-assets
33
---
44
# Input Action Assets
55

6-
The Input System stores your configuration of [Input Actions](Actions.md) and their associated [Bindings](ActionBindings.md), [Action Maps](ActionsEditor.html#configure-action-maps) and [Control Schemes](ActionBindings.md#control-schemes) in an [Action Asset](ActionAssets.md) file.
7-
8-
While it's possible to have more than one Action Asset in a project, most projects only ever need a single Action Asset.
9-
10-
These Assets have the `.inputactions` file extension and are stored in a plain JSON format.
11-
12-
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.
13-
14-
For most common scenarios, you do not need to use more than one Input Action Asset. This is because an Action Asset can contain multiple [Action Maps](ActionsEditor.html#configure-action-maps), which each containing a set of actions relevant to the various parts of your project (such as UI navigation, gameplay, etc).
15-
16-
## Descriptive heading
17-
18-
Use descriptive headings to break up the content and make the page easy to
19-
scan. Organize content logically and introduce ideas gradually.
20-
21-
### Detailed heading
22-
23-
Don't use headings below H3 level.
24-
25-
## Additional resources
26-
27-
- [Link](related-content-on-Unity-owned-platforms)
28-
- [Link](related-content-on-Unity-owned-platforms)
29-
30-
--------------------------------------------
31-
32-
[link](##bind)
33-
34-
- [Descriptive heading](#descriptive-heading)
35-
- [Detailed heading](#detailed-heading)
36-
- [Additional resources](#additional-resources)
37-
- [Project-Wide Actions](#project-wide-actions)
38-
- [Using Input Action Assets](#using-input-action-assets)
39-
- [Using Action Assets with `PlayerInput`](#using-action-assets-with-playerinput)
40-
- [Modifying Input Action Assets at runtime](#modifying-input-action-assets-at-runtime)
41-
42-
## Project-Wide Actions
43-
44-
The Input System's **project-wide actions** feature allows you to choose an individual Action Asset to be available project-wide, which means the actions within that asset are available more conveniently through the Input System API without needing to set up references to a specific asset.
45-
46-
When you assign an Action Asset as project-wide, it also becomes automatically [preloaded](https://docs.unity3d.com/ScriptReference/PlayerSettings.GetPreloadedAssets.html) when your app starts up, and is kept available until it terminates.
47-
48-
Unless you have specific project requirements that require more than one Action Asset, the recommended workflow is to use a single Action Asset assigned as the project-wide actions.
49-
50-
51-
52-
53-
## Using Input Action Assets
54-
55-
56-
### Using Action Assets with `PlayerInput`
57-
58-
The [Player Input](player-input-component.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.
59-
60-
![PlayerInput](Images/PlayerInput.png)
61-
62-
### Modifying Input Action Assets at runtime
63-
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).
6+
The Input System stores your configuration of [Input Actions](Actions.md) and their associated [Bindings](ActionBindings.md), [Action Maps](ActionsEditor.html#configure-action-maps) and [Control Schemes](ActionBindings.md#control-schemes) in an **Action Asset**.
7+
8+
Learn how to create, assign and use them in this section.
9+
10+
| **Topic** | **Description** |
11+
| :------------------------------ | :------------------------------- |
12+
| **[About action assets](./about-action-assets.md)** | More information to help you understand what action assets are for. |
13+
| **[Create and assign a project-wide action asset](create-project-wide-actions.md)** | Create an actions asset that contains the built-in default actions, and assign them as project-wide. |
14+
| **[Create an empty action asset](create-empty-action-asset.md)** | Create a new empty action asset. |
15+
| **[Assign a project-wide action asset](assign-project-wide-asset.md)** | Change which action asset is assigned as project-wide. |
16+
| **[Default actions](default-actions.md)** | When you create and assign default project-wide actions, the Action Asset comes pre-configured with some default Actions which suit many common app and game scenarios. Learn about them here. |
17+
| **[Generate C# API from actions](./link)** | 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. |
6418

6519

Packages/com.unity.inputsystem/Documentation~/assign-project-wide-actions.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
To assign an existing Actions Asset as project-wide, do one of the following:
44

5-
- Go to **Edit** > **Project Settings** > **Input System Package**, then drag the asset from your Project window into the **Project-wide Actions** field.
5+
1. Go to **Edit** > **Project Settings** > **Input System Package**
6+
2. Drag the asset from your Project window into the **Project-wide Actions** field.
7+
68
![image alt text](./Images/InputSettingsNoProjectWideAsset.png)</br>
79
*The Input System Package Project Settings with no project-wide actions assigned*
810

911
or:
1012

11-
- Select the Asset in your Project window, then in the Inspector window, select **Assign as the Project-wide Input Actions**.
13+
1. Select the Asset in your Project window
14+
2. In the Inspector window, select **Assign as the Project-wide Input Actions**.
1215

1316

1417
Only one Actions Asset can be assigned as project-wide. If a different asset was previously assigned as project-wide, it becomes unassigned.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Create an empty action asset
2+
3+
Usually you only need one Action Asset, assigned as the project-wide actions. The input package provides a convenient way to [create a set of useful default actions and assign them as project-wide](assign-project-wide-actions.md). In other cases, you might want to start with an empty actions asset, or create more than one actions asset.
4+
5+
To do this:
6+
7+
1. Go to __Assets > Create > Input Actions__ from Unity's main menu/
8+
9+
(or)
10+
11+
1. Click the project window's **Add (+)** button.
12+
2. Select **Input Actions** from the menu.
13+
14+
When you create an action asset this way, the new action asset is empty, containing no actions, action maps, or control schemes. You must [add](./create-actions.md) and [configure](./configure-actions.md) new actions to use it. The new action asset is also not assigned as [project-wide](./assign-project-wide-actions.md).
15+

Packages/com.unity.inputsystem/Documentation~/create-action-asset.md renamed to Packages/com.unity.inputsystem/Documentation~/create-project-wide-actions.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
# Create an action asset
2-
3-
In most cases, you only need one Action Asset, assigned as the project-wide actions. The input package provides a convenient way to create a set of useful default actions and assign them as project-wide. In other cases, you might want to start with an empty actions asset, or create more than one actions asset.
4-
5-
## Create and assign a default project-wide actions asset
1+
# Create and assign a default project-wide actions asset
62

73
Follow these steps to create an actions asset that contains the built-in [default actions](./TheDefaultActions.md), and assign them as project-wide.
84

@@ -29,13 +25,4 @@ When you create an action asset this way, the new asset contains a set of defaul
2925
![image alt text](./Images/ProjectSettingsInputActionsSimpleShot.png)
3026
*The Input System Package Project Settings after creating and assigning the default actions*
3127

32-
Once you have created and assigned project-wide actions, the Input System Package page in Project Settings displays the **Actions Editor** interface. Read more about how to use the [Actions Editor](ActionsEditor.md) to configure your actions.
33-
34-
## Create a new empty input action asset
35-
36-
In some situations you might want to start with an empty action asset, or create additional action assets.
37-
38-
To do this, go to __Assets > Create > Input Actions__ from Unity's main menu, or select **Input Actions** the Project window's **Add (+)** button menu.
39-
40-
When you create an action asset this way, the new action asset is empty, containing no actions, action maps, or control schemes. You must [add](./CreateActions.md) and [configure](./ConfigureActions.md) new actions to use it. The new action asset is also not assigned as [project-wide](./ProjectWideActions.md).
41-
28+
Once you have created and assigned project-wide actions, the Input System Package page in Project Settings displays the **Actions Editor** interface. Read more about how to use the [Actions Editor](ActionsEditor.md) to configure your actions.

Packages/com.unity.inputsystem/Documentation~/default-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The default project-wide actions
22

3-
When you [create and assign default project-wide actions](CreateActionAsset.md) the Action Asset comes pre-configured with some default Actions such as "Move", "Jump", and more, which suit many common app and game scenarios. They are configured to read input from the most common types of input controller such as Keyboard, Mouse, Gamepad, Touchscreen, and extended reality (XR).
3+
When you [create and assign default project-wide actions](./create-project-wide-actions.md) the Action Asset comes pre-configured with some default Actions such as "Move", "Jump", and more, which suit many common app and game scenarios. They are configured to read input from the most common types of input controller such as Keyboard, Mouse, Gamepad, Touchscreen, and extended reality (XR).
44

55
![image alt text](./Images/ProjectSettingsInputActionsSimpleShot.png)
66
*The Input System Package Project Settings after creating and assigning the default actions*

0 commit comments

Comments
 (0)