InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

Handling InputActionAsset in InputActionTrace

Open jimon opened this issue 3 years ago • 1 comments

Description

If binding resolution triggers (due to adding new device, etc) when InputActionTrace is used on InputAction from InputActionAsset, we fail with debug exception that the provided object in onActionChange is unexpected.

Because in this case onActionChange is invoked with InputActionAsset object and not InputAction or InputActionMap, which is not handled by InputActionTrace.

Changes made

  • Added branch in InputActionTrace to handle InputActionAsset, and clone all relevant states from the asset.
  • Modified the test to trigger the branch.

Notes

I don't know why we have m_ActionMapStateClones, they don't seem to be used? Are they needed because InputAction indirectly uses memory from them?

jimon avatar Jun 01 '22 12:06 jimon

CLA assistant check
All committers have signed the CLA.

unity-cla-assistant avatar Jun 01 '22 13:06 unity-cla-assistant