Fixed BindingSyntax.InsertPartBinding not assigning action
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,Addedsections. - 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.
- Explains the change in
- [ ] Tests added/changed, if applicable.
- Functional tests
Area_CanDoX,Area_CanDoX_EvenIfYIsTheCase,Area_WhenIDoX_AndYHappens_ThisIsTheResult. - Performance tests.
- Integration tests.
- Functional 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.
Has this been reviewed?
@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!
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.
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
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.