Handling InputActionAsset in InputActionTrace#1543
Merged
Conversation
andrew-oc
approved these changes
Jun 16, 2022
Contributor
andrew-oc
left a comment
There was a problem hiding this comment.
PR looks fine. Wanted to comment real quick that the m_ActionMapStateClones is needed so we can replay events later against the same set of bindings that were active when the events happened. If we didn't save them, all the binding indices and trigger states indices would potentially be wrong during a replay.
c21434a to
d11f511
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
If binding resolution triggers (due to adding new device, etc) when
InputActionTraceis used onInputActionfromInputActionAsset, we fail with debug exception that the provided object inonActionChangeis unexpected.Because in this case
onActionChangeis invoked withInputActionAssetobject and notInputActionorInputActionMap, which is not handled byInputActionTrace.Changes made
InputActionTraceto handleInputActionAsset, and clone all relevant states from the asset.Notes
I don't know why we have
m_ActionMapStateClones, they don't seem to be used? Are they needed becauseInputActionindirectly uses memory from them?