Generates static wrappers for strong-referencing input actions from Unity's Input system, as well as provides a system for easily remapping and displaying inputs
- Open the project settings (Edit → Project settings)
- Set it up under the 'Input Wrapper' section
- Namespace - the namespace you want the wrappers to be under
- Folder - the folder you want the wrappers to be located in
- Create an input actions asset with 'Generate C# Class' enabled
- Add it to the list in the project settings
- Class Name - The name for the wrapper class
- Generated Name - The name for the C# class generated from the input actions asset
- Generated Namespace - The namespace for the C# class generated from the input actions asset
- Asset - The input actions asset itself
- Add the
RebindingUI_Actioncomponent to a game object - Assign all the references in the inspector
- Assign the correct input action and label
- Download the icon pack by Xelu
- Batch rename the ones under "Keyboard & Mouse/{colour scheme}" to remove
_Key_Darkor_Key_Light(Q_Key_Dark -> Q) - Import them into your project
- Make a TextMeshPro sprite asset from them called
ButtonIconsand place it underResources / Sprite Assets(by default, see TextMeshPro project settings)- Set all the icons' sprite mode to single
- Create a sprite atlas with "Allow Rotation" disabled
- Add all the icons to it
- Create a sprite asset from the atlas using TMProSpriteAtlas or manually (good luck)
- Add the
ActionDisplaycomponent to a game object - Assign the
TMP_Textreference to the target text object - Assign references to all the actions, in the same order as they are in the text
- Any {0}, {1}, (...) (the same as string.Format()) in the text are replaced with their corresponding action's key, matching the user's keyboard layout