InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

Added ClearPartBindings to BindingSyntax

Open steinbitglis opened this issue 4 years ago • 1 comments

Description

This adds a method to BindingSyntax that removes/clears all the part bindings of a composite binding.

Changes made

The added method (ClearBindingParts) replaces code similar to this:

        void ClearBindingParts (BindingSyntax b) {
            if (b.valid)
                b = b.NextBinding();
            while (b.valid && b.binding.isPartOfComposite)
                b.Erase();
        }

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 29 '21 14:06 steinbitglis

I guess that in theory it could be an extension method, but it uses a lot of internal fields and stuff, so it makes more sense a proper method.

steinbitglis avatar Oct 04 '21 07:10 steinbitglis

Hi, thanks for your contribution! We gonna proceed with merging it with slight tweaks in #1641

jimon avatar Feb 13 '23 15:02 jimon