Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW: Add APIs to change or erase existing bindings on actions. #511

Merged
merged 1 commit into from Apr 8, 2019

Conversation

Rene-Damm
Copy link
Contributor

@Rene-Damm Rene-Damm commented Apr 3, 2019

@@ -225,6 +225,49 @@ private static int AddBindingInternal(InputActionMap map, InputBinding binding)
return bindingIndex;
}

public static BindingSyntax ChangeBinding(this InputAction action, int index)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the use case for using indexes? Iterating over all bindings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stuff like

for (var i = 0; i < myAction.bindings.Count; ++i)
    if (myAction.bindings[i].SomeKindOfCheck)
        myAction.ChangeBinding(i)....;

@Rene-Damm Rene-Damm merged commit 41f347f into develop Apr 8, 2019
@Rene-Damm Rene-Damm deleted the action-api-extensions branch April 8, 2019 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants