UnityGame/Library/PackageCache/com.unity.inputsystem/Samples~/RebindingUI
2024-10-27 10:53:47 +03:00
..
Icons Init commit 2024-10-27 10:53:47 +03:00
.sample.json Init commit 2024-10-27 10:53:47 +03:00
GamepadIconsExample.cs Init commit 2024-10-27 10:53:47 +03:00
GamepadIconsExample.cs.meta Init commit 2024-10-27 10:53:47 +03:00
Icons.meta Init commit 2024-10-27 10:53:47 +03:00
README.md Init commit 2024-10-27 10:53:47 +03:00
README.md.meta Init commit 2024-10-27 10:53:47 +03:00
RebindActionUI.cs Init commit 2024-10-27 10:53:47 +03:00
RebindActionUI.cs.meta Init commit 2024-10-27 10:53:47 +03:00
RebindActionUIEditor.cs Init commit 2024-10-27 10:53:47 +03:00
RebindActionUIEditor.cs.meta Init commit 2024-10-27 10:53:47 +03:00
RebindingUISampleScene.unity Init commit 2024-10-27 10:53:47 +03:00
RebindingUISampleScene.unity.meta Init commit 2024-10-27 10:53:47 +03:00
RebindSaveLoad.cs Init commit 2024-10-27 10:53:47 +03:00
RebindSaveLoad.cs.meta Init commit 2024-10-27 10:53:47 +03:00
RebindUIPrefab.prefab Init commit 2024-10-27 10:53:47 +03:00
RebindUIPrefab.prefab.meta Init commit 2024-10-27 10:53:47 +03:00
RebindUISampleActions.inputactions Init commit 2024-10-27 10:53:47 +03:00
RebindUISampleActions.inputactions.meta Init commit 2024-10-27 10:53:47 +03:00
Unity.InputSystem.RebindingUI.asmdef Init commit 2024-10-27 10:53:47 +03:00
Unity.InputSystem.RebindingUI.asmdef.meta Init commit 2024-10-27 10:53:47 +03:00

This sample demonstrates how to use the Input System APIs to set up a rebinding UI. The main file is RebindActionUI which, aside from serving as an example, contains a reusable MonoBehaviour component for composing rebinding UIs. The RebindUIPrefab contains a ready-made prefab that can be used as a simple drop-in setup for rebinding an individual action.

To demonstrate how to use images instead of textual display strings, take a look at GamepadIconsExample.

Finally, the RebindSaveLoad script demonstrates how to persist user rebinds in PlayerPrefs and how to restore them from there.

The icons used in the sample are taken from Free Prompts Pack v4.0 created by, and made available to public domain by Nicolae Berbece. Icons are licensed under Creative Commons CC0.