Unity-Technologies/InputSystem

FindAction Method from InputSystem

Maesla opened this issue · 1 comments

InputActionAsset has a very useful method, FindAction.

This method takes care of simple_names and map_name/simple_name.

In the other hands, InputSystem has a method, ListEnabledActions, but it doesn't implement a FindAction method, so if you want to take care about complex names, you have to implement it yourself.

It would be nice to have a method in InputSystem like this:
InputAction InputSystem.FindEnabledAction(string actionNameOrId, bool throwIfNotFound = false)
with the same logic of
InputAction InputActionAsset.FindAction(string actionNameOrId, bool throwIfNotFound = false)
See InputActionAsset.cs, line 521

Or maybe this algorithm could be a static method, so it can be used in a search from outside.

Thank you

Yup, made a note. Indeed makes sense to have this work generically on any IEnumerable (as well as specifically on IInputActionCollection).

Closing this as part of us getting GitHub issues turned off.