Skip to content

Silpux/InputSystemRebindActionUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Input System 1.11.2 Rebinding UI for C# generated class

Rebinding UI. Works with TMPro, overlay, has same custom inspector as Rebinding UI sample (except of events section).

Usage

  1. Paste InputManager.cs, RebindActionUI.cs, RebindActionUIEditor.cs to project
  2. In InputManager.cs, replace PlayerInputActions to your generated class
  3. Add RebindActionUI to object in scene, drag InputActionReference that you want to rebind, select binding
  4. Add UnityEvent for button that will initiate the rebind, and select StartInteractiveRebind method from object from previous step
  5. To reset binding to default, create button and select ResetToDefault method call from RebindActionUI component
  6. Access your input actions generated class instance through InputManager:
    private PlayerInputActions playerInputActions;

    private void Awake(){
        playerInputActions = InputManager.InputActions;
    }
  1. In order to subscribe to rebinding events:
    private void OnEnable(){
        InputManager.onRebindStarted += Started;
        InputManager.onRebindCanceled += Canceled;
        InputManager.onRebindComplete += Completed;
    }

    private void OnDisable(){
        InputManager.onRebindStarted -= Started;
        InputManager.onRebindCanceled -= Canceled;
        InputManager.onRebindCompleted -= Completed;
    }

About

Input System 1.11.2 `Rebinding UI` for C# generated class

Topics

Resources

Stars

Watchers

Forks

Languages