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
This sample demonstrates how to use the Input System APIs to set up a rebinding UI. The main file is [RebindActionUI](./RebindActionUI.cs) which, aside from serving as an example, contains a reusable `MonoBehaviour` component for composing rebinding UIs. The [RebindUIPrefab](./RebindUIPrefab.prefab) contains a ready-made prefab that can be used as a simple drop-in setup for rebinding an individual action.
1
+
This sample demonstrates how to use the Input System APIs to set up a rebinding UI. The main file is
2
+
[RebindActionUI](./RebindActionUI.cs) which, aside from serving as an example, contains a reusable `MonoBehaviour`
3
+
component for composing rebinding UIs. The [RebindUIPrefab](./RebindUIPrefab.prefab) contains a ready-made prefab that
4
+
can be used as a simple drop-in setup for rebinding an individual action.
2
5
3
-
To demonstrate how to use images instead of textual display strings, take a look at [GamepadIconsExample](./GamepadIconsExample.cs).
6
+
To demonstrate how to use images instead of textual display strings, take a look at
7
+
[GamepadIconsExample](./GamepadIconsExample.cs).
4
8
5
-
To demonstrate how to show dynamic texts based on input action bindings, see [ActionLabel](./ActionLabel.cs).
9
+
To demonstrate how to show dynamic UI texts based on input action bindings, see [ActionLabel](./ActionLabel.cs).
6
10
7
-
Finally, the [RebindSaveLoad](./RebindSaveLoad.cs) script demonstrates how to persist user rebinds in `PlayerPrefs` and how to restore them from there.
11
+
[InputActionIndicator](./InputActionIndicator.cs) and [InputActionIndicator.prefab](./InputActionIndicator.prefab)
12
+
shows how to make a simple UI indicator that shows whether an associated input action is enabled, disabled or
13
+
performed. This behavior has been added to this sample to add observability of actions triggered within gameplay,
14
+
menu and rebind contexts.
8
15
9
-
The icons used in the sample are taken from [Free Prompts Pack v4.0](https://opengameart.org/content/free-keyboard-and-controllers-prompts-pack) created by, and made available to public domain by Nicolae Berbece.
10
-
Icons are licensed under [Creative Commons CC0](https://creativecommons.org/publicdomain/zero/1.0/).
16
+
The [RebindSaveLoad](./RebindSaveLoad.cs) script demonstrates how to persist user rebinds in `PlayerPrefs` and how
17
+
to restore them.
18
+
19
+
In this sample, keyboard bindings for "Move" (default WASD) is rebound as a single composite. This means that
20
+
indivudual parts will get assigned one after the other. Another way of doing this is to set it up as four individual
21
+
button bindings and assign them individually as four partial bindings.
22
+
23
+
In this sample it is possible to directly rebind gamepad sticks in the gamepad control scheme. In practice, you
24
+
probably don't want to set up rebinding the sticks like this but rather have a "swap sticks" kind of toggle instead.
25
+
In this sample we have both variants for demonstration purposes. See [RebindActionUI.SwapBinding](./RebindActionUI.cs)
26
+
for a method that swaps two bindings of similar type.
27
+
28
+
The icons used in the sample are taken from
29
+
[Free Prompts Pack v4.0](https://opengameart.org/content/free-keyboard-and-controllers-prompts-pack) created by,
30
+
and made available to public domain by Nicolae Berbece.
31
+
Icons are licensed under [Creative Commons CC0](https://creativecommons.org/publicdomain/zero/1.0/).
0 commit comments