This repository contains utility scripts for Unity's Input System package, used in Audune's own projects.
- Get references to an input binding or a group of input bindings from an input action, which include their associated bindex, action and control scheme. Rebind references via scripting.
- Return all available control schemes in the input system, and optionally filter them to only include the most specific ones. Normalize control paths using those control schemes for easier rebinding.
- Convert binding referenes to their string representation, either in plain text or as TextMesh Pro sprites.
This package depends on the following packages:
- Input System (Unity), version 1.5.0 or higher.
To install this package as a package from the OpenUPM registry in the Unity Editor, use the following steps:
- In the Unity editor, navigate to Edit › Project Settings... › Package Manager.
- Add the following Scoped Registry, or edit the existing OpenUPM entry to include the new Scope:
Name: package.openupm.com
URL: https://package.openupm.com
Scope(s): com.audune.utils.inputsystem
- Navigate to Window › Package Manager.
- Click the + icon and click Add package by name...
- Enter the following name in the corresponding field and click Add:
com.audune.utils.inputsystem
To install this package as a Git package in the Unity Editor, use the following steps:
- In the Unity editor, navigate to Window › Package Manager.
- Click the + icon and click Add package from git URL...
- Enter the following URL in the URL field and click Add:
https://github.com/audunegames/inputsystem-utils.git
The package contains the following classes:
- The
BindingReference
class is a wrapper aroundUnity.InputSystem.InputBinding
and also contains the associatedUnity.InputSystem.InputAction
,Unity.InputSystem.InputControlScheme
and binding index. - The
BindingReferenceGroup
class is a wrapper aroundIEnumerable<Unity.InputSystem.InputBinding>
and also contains the associatedUnity.InputSystem.InputAction
,Unity.InputSystem.InputControlScheme
and part of composite name. - The
ControlSchemeReference
class is a wrapper aroundUnity.InputSystem.InputControlScheme
and contains the devices that are currently used by the control scheme. - The
InputActionUtils
class contains extension methods for actions in the input system. - The
InputControlSchemeUtils
class contains extension methods for control schemes in the input system. - The
InputDisplayUtils
class contains extension methods for displaying bindings as strings. - The
TextMeshProSprite
class is a convenient wrapper around a string containing rich text for a TextMeshPro sprite.
Contributions to this package are more than welcome! Contributing can be done by making a pull request with your updated code.
This package is licensed under the GNU LGPL 3.0 license. See LICENSE.txt
for more information.