InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

Fixed BindingSyntax.InsertPartBinding not assigning action

Open steinbitglis opened this issue 4 years ago • 1 comments

Description

BindingSyntax.InsertPartBinding was not assigning the action field on the inserted binding. action on part bindings are required by InputActionMap.SetUpPerActionCachedBindingData()

Changes made

InputActionSetupExtensions.InsertPartBinding now passes on the action to the created part binding.

Checklist

Before review:

  • [ ] Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • FogBugz ticket attached, example ([case %number%](https://issuetracker.unity3d.com/issues/...)).
    • FogBugz is marked as "Resolved" with next release version correctly set.
  • [ ] Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • [ ] Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • [ ] Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

steinbitglis avatar Jun 14 '21 10:06 steinbitglis

Has this been reviewed?

steinbitglis avatar Oct 04 '21 07:10 steinbitglis

@steinbitglis Thank you for your contribution! And sorry for the long delay in giving feedback. It is currently being reviewed. Do you have any use cases for this? I can't find SetUpPerActionCachedBindingData() in the codebase. Thanks!

jfreire-unity avatar Mar 03 '23 10:03 jfreire-unity

It's been 627 days. I've forgotten these things, but the way I remember it was that the input system broke if / when i remapped buttons in our own remapping UI, and the reason was that this method had unexpected behaviour.

steinbitglis avatar Mar 03 '23 11:03 steinbitglis

I'm not sure if this is relevant, but maybe: (m_ActionMap.ClearPerActionCachedBindingData(); being called on line 1449) https://github.com/Unity-Technologies/InputSystem/pull/1360/files

steinbitglis avatar Mar 03 '23 12:03 steinbitglis

After looking into this, I noticed there were a lot of changes in this part of the code which seem to fix the issue with SetUpPerActionCachedBindingData() (now called SetUpPerActionControlAndBindingArrays()). If a similar problem occurs again, we can re-open this and make a fix. Thank you @steinbitglis.

jfreire-unity avatar Mar 06 '23 16:03 jfreire-unity