IndieGame/client/Packages/com.unity.inputsystem@1.7.0/Samples~/RebindingUI
DOBEST\zhaoyingjie f242607587 初始化工程
2024-10-11 10:12:15 +08:00
..
Icons 初始化工程 2024-10-11 10:12:15 +08:00
.sample.json 初始化工程 2024-10-11 10:12:15 +08:00
GamepadIconsExample.cs 初始化工程 2024-10-11 10:12:15 +08:00
GamepadIconsExample.cs.meta 初始化工程 2024-10-11 10:12:15 +08:00
Icons.meta 初始化工程 2024-10-11 10:12:15 +08:00
README.md 初始化工程 2024-10-11 10:12:15 +08:00
README.md.meta 初始化工程 2024-10-11 10:12:15 +08:00
RebindActionUI.cs 初始化工程 2024-10-11 10:12:15 +08:00
RebindActionUI.cs.meta 初始化工程 2024-10-11 10:12:15 +08:00
RebindActionUIEditor.cs 初始化工程 2024-10-11 10:12:15 +08:00
RebindActionUIEditor.cs.meta 初始化工程 2024-10-11 10:12:15 +08:00
RebindingUISampleScene.unity 初始化工程 2024-10-11 10:12:15 +08:00
RebindingUISampleScene.unity.meta 初始化工程 2024-10-11 10:12:15 +08:00
RebindSaveLoad.cs 初始化工程 2024-10-11 10:12:15 +08:00
RebindSaveLoad.cs.meta 初始化工程 2024-10-11 10:12:15 +08:00
RebindUIPrefab.prefab 初始化工程 2024-10-11 10:12:15 +08:00
RebindUIPrefab.prefab.meta 初始化工程 2024-10-11 10:12:15 +08:00
RebindUISampleActions.inputactions 初始化工程 2024-10-11 10:12:15 +08:00
RebindUISampleActions.inputactions.meta 初始化工程 2024-10-11 10:12:15 +08:00
Unity.InputSystem.RebindingUI.asmdef 初始化工程 2024-10-11 10:12:15 +08:00
Unity.InputSystem.RebindingUI.asmdef.meta 初始化工程 2024-10-11 10:12:15 +08: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.