Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docf 5905 cm reorg setting up #2022

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from
Prev Previous commit
WIP DOCF-5905
  • Loading branch information
duckets committed Jan 13, 2025
commit 803b21d18c96fa96c4fa822647647ba78698fd37
Original file line number Diff line number Diff line change
@@ -3,11 +3,11 @@

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.

The input system creates an Action Asset when you set up the [default project-wide actions](about-project-wide-actions.md), but you can also create new Action Assets directly in the Project window.
## Project-wide action assets

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).
The Input System creates an Action Asset when you set up the [default project-wide actions](about-project-wide-actions.md), which is the most common and recommended workflow, but you can also [create new empty Action Assets](./create-empty-action-asset.md) directly in the Project window.

## Modifying Input Action Assets at runtime
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).
## Action maps

Actions assets allow you to group sets of related actions into [action maps](./create-edit-delete-action-maps.md). For example, in an open-world city game, you might create separate action maps for different situations such as exploring on foot, driving a car, flying an aircraft, or navigating UI interfaces. This means, for most common scenarios, you don't need to use more than one Input Action Asset.

Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ Action maps provide a way to group collections of Actions that represent differe

Actions must belong to an Action Map, therefore if you are starting with an empty Actions Asset, you must create an action map before you can create any actions.

The Action Maps section of the Actions Editor allows you to create, rename, delete, and duplicate Action Maps.
The Action Maps section on the left side of the [Actions Editor window](./actions-editor.md) allows you to create, rename, delete, and duplicate Action Maps.

* To add a new Action Map, select the Add (+) icon in the header of the Action Map panel.
* 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 (`/`).
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Create an empty action asset

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.
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) which is the most common and recommended workflow. In other cases, you might want to start with an empty actions asset, or create more than one actions asset.

To do this:

Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ If you don't yet have an Action Asset assigned as project-wide in your project,
![image alt text](./Images/InputSettingsNoProjectWideAsset.png)</br>
*The Input System Package Project Settings with no project-wide actions assigned*

> **Note:** If you already have an Action Asset assigned, this button is not displayed, and instead the Actions Editor is displayed, allowing you to edit the project-wide actions.
> **Note:** If you already have an Action Asset assigned, this button is not displayed, and instead the Actions Editor is displayed, allowing you to edit the currently assigned project-wide actions.

Click **"Create a new project-wide Action Asset"**.

16 changes: 4 additions & 12 deletions Packages/com.unity.inputsystem/Documentation~/default-actions.md
Original file line number Diff line number Diff line change
@@ -11,15 +11,7 @@ These default actions mean that in many cases, you can start scripting with the

### The legacy default Actions Asset

The Input System Package also comes with an asset called `DefaultInputActions.inputactions` containing a default setup of Actions. This default actions asset is older than, and entirely separate from the default project-wide actions described above. It is a legacy asset that remains included in the package for backward compatibility. 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.

```CSharp
void Start()
{
// Create an instance of the default actions.
var actions = new DefaultInputActions();
actions.Player.Look.performed += OnLook;
actions.Player.Move.performed += OnMove;
actions.Enable();
}
```
The Input System Package also comes with an asset called `DefaultInputActions.inputactions` containing a default set of Actions. This default actions asset is older than, and entirely separate from the default project-wide actions described above.

This is a legacy asset that remains included in the package for backward compatibility only, and not recommended for use in new projects. It should not be confused with the default project-wide actions described above.

Loading