interaction - eisclimber/ExPresS-XR GitHub Wiki
Classes for interacting with the world in XR, such as buttons, sockets and interactables.
| Name | Description |
|---|---|
| BaseButton | Implements a basic 3D button that can be physically pressed in VR. It may be used as base class to extend on the behavior. |
The button can be disabled and used as toggle by setting the respective booleans to true.
Also the button press can be augmented with sounds for pressing and releasing the buttons.
It features two anchors for the base and the push anchor:
- The base anchor stays in place as it acts as the base of the button.
- The push anchor will move when being pushed, so anything that should move when being pushed can be a child of this, e.g. the button cap.
It also hold a collider which is used to determine if the button should be pressed which can be customized to fit the objects in the anchor by changing colliderSize.
There are a multitude of Events to listen to including for being pressed, released, reset and having inputDisabled. Note that there are separate Events for toggleMode and normalMode, that are emitted exclusively in these modes. Meaning OnPressed will NOT be triggered if toggleMode = true but instead OnTogglePressed.
A set of buttons can be instantiated via the context menu. To create a custom button it is recommended starting with the empty button prefab.
In order to change color, a ColorSwitcher-Component can be added to components of the push anchor and be connected with the OnPressed and OnReleased (and/or OnTogglePressed and OnToggleReleased) signals to change colors. For reference have a look on the instantiable button prefabs (except the empty one).
For testing button pressed in the editor the ContextMenu of the Button has options to emit the pressed events manually.| |ExPresSXRGrabInteractable|Acts as a wrapper for allowing XRGrabInteractables to be scaled while being held. This will not scale the GameObject itself but all of it's children. Scaling will be applied to the children using their initial scale.|
| Name | Description |
|---|---|
| ExPresSXR.Interaction.ButtonQuiz | Classes for the button quiz. |
| ExPresSXR.Interaction.Feedback | Classes for player feedback, such as haptics and audio. |
| ExPresSXR.Interaction.Interactables | Classes for interactable objects. |
| ExPresSXR.Interaction.Interactors | Classes for interactors. |
| ExPresSXR.Interaction.ValueRangeInteractable | Classes for value range interactables, such as sliders and levers. |