feat(InputActionProperty): add functionality based around InputActions #39
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.
The InputActionProperty of the Unity Input System allows for listening to Input System Action events directly based off an input system action reference or from a direct binding.
This is cleaner and easier to understand than the CallbackContext with Unity Events so it has been used to create some new prefabs in the samples directory.
The new InputActionPropertyVelocityTracker will track velocity of an input system action which can be based off OpenXR device data, meaning the velocity reported should be compatible with the specific device rather than trying to use estimations.
The new InputActionPropertyTransformer can also be used in place of the CallbackContextTransformer to provide a direct reference to an Input Action (or direct binding) which can be used to pick up action input directly within the component rather than having to go through the PlayerInput script and pass the context via a Unity Event to the CallbackContextTransformer.
The InputActions_GenericXR.inputactions mapping has also been updated to include pose data for the HMD, controllers and pointer, which includes position, rotation and velocity information.
This has all formalised in the creation of two new prefabs:
This has also meant the UnityInputSystem.Mappings.GenericXR.prefab has been renamed to
UnityInputSystem.CallbackContextMappings.GenericXR.prefab and this should not technically be considered as deprecated as it may still be useful or even the preferred usage, but by default the new InputActionMappings.GenericXR.prefab should be used.